Files
piratepoet/tests/integration/API/APITest.php
Rostislav Wolny de5385ed03 Get rid of static instantiation of JSON API
[MAILPOET-1689]
2018-12-17 15:02:42 +01:00

22 lines
527 B
PHP

<?php
namespace MailPoet\Test\API;
use MailPoet\API\API;
use MailPoet\Config\AccessControl;
class APITest extends \MailPoetTest {
function testItCallsMPAPI() {
expect(API::MP('v1'))->isInstanceOf('MailPoet\API\MP\v1\API');
}
function testItThrowsErrorWhenWrongMPAPIVersionIsCalled() {
try {
API::MP('invalid_version');
$this->fail('Incorrect API version exception should have been thrown.');
} catch(\Exception $e) {
expect($e->getMessage())->equals('Invalid API version.');
}
}
}