Files
piratepoet/tests/unit/API/JSON/v1/SetupTest.php
Vlad 8b13889c7a Adds one entry point for both JSON and MP APIs
Removes endpoints folder and moves versions to the root
JSON API folder
2017-05-16 20:56:55 -04:00

31 lines
807 B
PHP

<?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();
}
}