mailgun-php/tests/Mailgun/Tests/Unsubscribes/UnsubscribeTest.php

40 lines
1.2 KiB
PHP
Raw Normal View History

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(){
$unsub = $this->client->Unsubscribes();
$response = $unsub->addAddress("test@samples.mailgun.org");
$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(){
$unsub = $this->client->Unsubscribes();
$response = $unsub->deleteAddress("test@samples.mailgun.org");
$httpCode = $response->http_response_code;
$this->assertEquals(200, $httpCode);
}
public function testGetAddress(){
$unsub = $this->client->Unsubscribes();
$response = $unsub->getAddress("test@samples.mailgun.org");
$httpCode = $response->http_response_code;
$this->assertEquals(200, $httpCode);
}
public function testGetAddresses(){
$unsub = $this->client->Unsubscribes();
$response = $unsub->getAddresses("1", "30");
$httpCode = $response->http_response_code;
2013-07-24 04:34:50 +04:00
$this->assertEquals(200, $httpCode);
}
}