Unit testing for CakePHP 3 Plugin

I have created a plugin for CakePHP which enables users to send an email using Mailgun API. It is working fine.

I have written test cases for the Transport class, but I am not satisfied with the way of structuring the test cases and mocking the Mailgun transport class.

Can someone help me to restructure my test cases in valid CakePHP way?

Here is the link to plugin repo: https://github.com/narendravaghela/cakephp-mailgun

Thanks