Move mocks

Created a Mocks directory to seperate mocks from classes.

I moved Mailgun\Tests\MailGunTest to Mailgun\Test\Mocks\Mailgun. As it's not a
test it's a mock. So shouldn't be suffixed with Test.

I mocked Mailgun\Tests\Connection\TestBroker to Mailgun\Tests\Mocks\Connection\TestBroker as it's a mock and should be with other mocks.
This commit is contained in:
Iain Cambridge 2014-05-13 14:25:26 +01:00
parent 08e67d8e9e
commit 3af838f2c8
7 changed files with 16 additions and 16 deletions

View File

@ -1,7 +1,7 @@
<?PHP
namespace Mailgun\Tests\Connection;
use Mailgun\Tests\MailgunTest;
use Mailgun\Tests\Mock\Mailgun;
class ConnectionTest extends \Mailgun\Tests\MailgunTestCase{
@ -10,7 +10,7 @@ class ConnectionTest extends \Mailgun\Tests\MailgunTestCase{
public function setUp(){
}
public function testNewClientInstantiation(){
$this->client = new MailgunTest("My-Super-Awesome-API-Key", "samples.mailgun.org", false);
$this->client = new Mailgun("My-Super-Awesome-API-Key", "samples.mailgun.org", false);
}
}

View File

@ -1,7 +1,7 @@
<?PHP
namespace Mailgun\Tests\Lists;
use Mailgun\Tests\MailgunTest;
use Mailgun\Tests\Mock\Mailgun;
class OptInHandler extends \Mailgun\Tests\MailgunTestCase{
@ -10,7 +10,7 @@ class OptInHandler extends \Mailgun\Tests\MailgunTestCase{
private $optInHandler;
public function setUp(){
$this->client = new MailgunTest("My-Super-Awesome-API-Key");
$this->client = new Mailgun("My-Super-Awesome-API-Key");
$this->optInHandler = $this->client->OptInHandler();
}

View File

@ -1,7 +1,7 @@
<?PHP
namespace Mailgun\Tests\Messages;
use Mailgun\Tests\MailgunTest;
use Mailgun\Tests\Mock\Mailgun;
class BatchMessageTest extends \Mailgun\Tests\MailgunTestCase{
@ -9,7 +9,7 @@ class BatchMessageTest extends \Mailgun\Tests\MailgunTestCase{
private $sampleDomain = "samples.mailgun.org";
public function setUp(){
$this->client = new MailgunTest("My-Super-Awesome-API-Key");
$this->client = new Mailgun("My-Super-Awesome-API-Key");
}
public function testBlankInstantiation(){
$message = $this->client->BatchMessage($this->sampleDomain);

View File

@ -1,13 +1,13 @@
<?PHP
namespace Mailgun\Tests\Messages;
use Mailgun\Tests\MailgunTest;
use Mailgun\Tests\Mock\Mailgun;
class MessageBuilderTest extends \Mailgun\Tests\MailgunTestCase{
private $client;
public function setUp(){
$this->client = new MailgunTest("My-Super-Awesome-API-Key", "samples.mailgun.org", false);
$this->client = new Mailgun("My-Super-Awesome-API-Key", "samples.mailgun.org", false);
}
public function testBlankInstantiation(){
$message = $this->client->MessageBuilder();

View File

@ -1,7 +1,7 @@
<?PHP
namespace Mailgun\Tests\Messages;
use Mailgun\Tests\MailgunTest;
use Mailgun\Tests\Mock\Mailgun;
class StandardMessageTest extends \Mailgun\Tests\MailgunTestCase{
@ -9,7 +9,7 @@ class StandardMessageTest extends \Mailgun\Tests\MailgunTestCase{
private $sampleDomain = "samples.mailgun.org";
public function setUp(){
$this->client = new MailgunTest("My-Super-Awesome-API-Key");
$this->client = new Mailgun("My-Super-Awesome-API-Key");
}
public function testSendMIMEMessage(){
$customMime = "Received: by luna.mailgun.net with SMTP mgrt 8728174999085; Mon, 10 Jun 2013 09:50:58 +0000

View File

@ -1,9 +1,9 @@
<?php
namespace Mailgun\Tests\Connection;
namespace Mailgun\Tests\Mock\Connection;
use Mailgun\Connection\RestClient;
class TestBroker extends RestClient{
class TestBroker extends RestClient {
private $apiKey;
protected $apiEndpoint;

View File

@ -1,11 +1,11 @@
<?PHP
namespace Mailgun\Tests;
namespace Mailgun\Tests\Mock;
use Mailgun\Mailgun;
use Mailgun\Tests\Connection\TestBroker;
use Mailgun\Mailgun as Base;
use Mailgun\Tests\Mock\Connection\TestBroker;
class MailgunTest extends Mailgun
class Mailgun extends Base
{
protected $debug;
protected $restClient;