Adds version support to public API
This commit is contained in:
21
tests/unit/API/Endpoints/v1/MailerTest.php
Normal file
21
tests/unit/API/Endpoints/v1/MailerTest.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use MailPoet\API\Endpoints\v1\Mailer;
|
||||
use MailPoet\API\Response as APIResponse;
|
||||
use MailPoet\Mailer\MailerLog;
|
||||
|
||||
class MailerEndpointTest extends MailPoetTest {
|
||||
function testItResumesSending() {
|
||||
// create mailer log with a "paused" status
|
||||
$mailer_log = array('status' => MailerLog::STATUS_PAUSED);
|
||||
MailerLog::updateMailerLog($mailer_log);
|
||||
$mailer_log = MailerLog::getMailerLog();
|
||||
expect($mailer_log['status'])->equals(MailerLog::STATUS_PAUSED);
|
||||
// resumeSending() method should clear the mailer log's status
|
||||
$mailer_endpoint = new Mailer();
|
||||
$response = $mailer_endpoint->resumeSending();
|
||||
expect($response->status)->equals(APIResponse::STATUS_OK);
|
||||
$mailer_log = MailerLog::getMailerLog();
|
||||
expect($mailer_log['status'])->null();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user