Adds one entry point for both JSON and MP APIs

Removes endpoints folder and moves versions to the root
JSON API folder
This commit is contained in:
Vlad
2017-05-10 18:20:32 -04:00
parent 3c7ac5488a
commit 8b13889c7a
30 changed files with 49 additions and 48 deletions

View File

@@ -84,7 +84,7 @@ class APITest extends MailPoetTest {
function testItAcceptsAndProcessesAPIVersion() {
$namespace = array(
'name' => 'MailPoet\API\JSON\Endpoints\v2',
'name' => 'MailPoet\API\JSON\v2',
'version' => 'v2'
);
$this->api->addEndpointNamespace($namespace['name'], $namespace['version']);
@@ -98,13 +98,13 @@ class APITest extends MailPoetTest {
expect($this->api->getRequestedAPIVersion())->equals('v2');
expect($this->api->getRequestedEndpointClass())->equals(
'MailPoet\API\JSON\Endpoints\v2\NamespacedEndpointStub'
'MailPoet\API\JSON\v2\NamespacedEndpointStub'
);
}
function testItCallsAddedEndpoints() {
$namespace = array(
'name' => 'MailPoet\API\JSON\Endpoints\v1',
'name' => 'MailPoet\API\JSON\v1',
'version' => 'v1'
);
$this->api->addEndpointNamespace($namespace['name'], $namespace['version']);
@@ -123,7 +123,7 @@ class APITest extends MailPoetTest {
function testItCallsAddedEndpointsForSpecificAPIVersion() {
$namespace = array(
'name' => 'MailPoet\API\JSON\Endpoints\v2',
'name' => 'MailPoet\API\JSON\v2',
'version' => 'v2'
);
$this->api->addEndpointNamespace($namespace['name'], $namespace['version']);