2013-07-24 04:34:50 +04:00
|
|
|
<?PHP
|
|
|
|
|
|
|
|
namespace Mailgun\Tests\Unsubscribes;
|
|
|
|
|
2013-07-25 03:25:24 +04:00
|
|
|
use Mailgun\Tests\MailgunClientTest;
|
2013-07-24 04:34:50 +04:00
|
|
|
|
|
|
|
class UnsubscribeTest extends \Mailgun\Tests\MailgunTestCase{
|
|
|
|
|
|
|
|
private $client;
|
|
|
|
|
|
|
|
public function setUp(){
|
2013-07-25 03:25:24 +04:00
|
|
|
$this->client = new MailgunClientTest("My-Super-Awesome-API-Key", "samples.mailgun.org", false);
|
2013-07-24 04:34:50 +04:00
|
|
|
|
|
|
|
}
|
2013-07-25 03:25:24 +04:00
|
|
|
public function testAddAddress(){
|
2013-07-25 04:43:24 +04:00
|
|
|
$client = $this->client->Unsubscribes();
|
|
|
|
$response = $client->addAddress("test@samples.mailgun.org");
|
2013-07-25 03:25:24 +04:00
|
|
|
$httpCode = $response->http_response_code;
|
2013-07-24 04:34:50 +04:00
|
|
|
$this->assertEquals(200, $httpCode);
|
|
|
|
}
|
2013-07-25 03:25:24 +04:00
|
|
|
public function testDeleteAddress(){
|
2013-07-25 04:43:24 +04:00
|
|
|
$client = $this->client->Unsubscribes();
|
|
|
|
$response = $client->deleteAddress("test@samples.mailgun.org");
|
2013-07-25 03:25:24 +04:00
|
|
|
$httpCode = $response->http_response_code;
|
|
|
|
$this->assertEquals(200, $httpCode);
|
|
|
|
}
|
|
|
|
public function testGetAddress(){
|
2013-07-25 04:43:24 +04:00
|
|
|
$client = $this->client->Unsubscribes();
|
|
|
|
$response = $client->getUnsubscribe("test@samples.mailgun.org");
|
2013-07-25 03:25:24 +04:00
|
|
|
$httpCode = $response->http_response_code;
|
|
|
|
$this->assertEquals(200, $httpCode);
|
|
|
|
}
|
|
|
|
public function testGetAddresses(){
|
2013-07-25 04:43:24 +04:00
|
|
|
$client = $this->client->Unsubscribes();
|
|
|
|
$response = $client->getUnsubscribes("1", "30");
|
2013-07-25 03:25:24 +04:00
|
|
|
$httpCode = $response->http_response_code;
|
2013-07-24 04:34:50 +04:00
|
|
|
$this->assertEquals(200, $httpCode);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|