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:
30
tests/unit/API/JSON/v1/SetupTest.php
Normal file
30
tests/unit/API/JSON/v1/SetupTest.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
use Helper\WordPressHooks as WPHooksHelper;
|
||||
use MailPoet\API\JSON\Response as APIResponse;
|
||||
use MailPoet\API\JSON\v1\Setup;
|
||||
use MailPoet\Models\Setting;
|
||||
|
||||
class SetupTest extends MailPoetTest {
|
||||
function _before() {
|
||||
Setting::setValue('signup_confirmation.enabled', false);
|
||||
}
|
||||
|
||||
function testItCanReinstall() {
|
||||
WPHooksHelper::interceptDoAction();
|
||||
|
||||
$router = new Setup();
|
||||
$response = $router->reset();
|
||||
expect($response->status)->equals(APIResponse::STATUS_OK);
|
||||
|
||||
$signup_confirmation = Setting::getValue('signup_confirmation.enabled');
|
||||
expect($signup_confirmation)->true();
|
||||
|
||||
$hook_name = 'mailpoet_setup_reset';
|
||||
expect(WPHooksHelper::isActionDone($hook_name))->true();
|
||||
}
|
||||
|
||||
function _after() {
|
||||
WPHooksHelper::releaseAllHooks();
|
||||
Setting::deleteMany();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user