Move WPHooks methods to WPFunctions

This commit is contained in:
Amine Ben hammou
2019-01-28 19:00:19 +01:00
parent d452cfcae7
commit 8b602bd947
49 changed files with 354 additions and 258 deletions

View File

@ -3,10 +3,11 @@
namespace MailPoet\Test\API\JSON\v1;
use MailPoet\API\JSON\v1\AutomatedLatestContent;
use MailPoet\WP\Functions as WPFunctions;
class AutomatedLatestContentTest extends \MailPoetTest {
function testItGetsPostTypes() {
$endpoint = new AutomatedLatestContent(new \MailPoet\Newsletter\AutomatedLatestContent());
$endpoint = new AutomatedLatestContent(new \MailPoet\Newsletter\AutomatedLatestContent(), new WPFunctions);
$response = $endpoint->getPostTypes();
expect($response->data)->notEmpty();
foreach($response->data as $post_type) {
@ -17,7 +18,7 @@ class AutomatedLatestContentTest extends \MailPoetTest {
}
function testItDoesNotGetPostTypesExludedFromSearch() {
$endpoint = new AutomatedLatestContent(new \MailPoet\Newsletter\AutomatedLatestContent());
$endpoint = new AutomatedLatestContent(new \MailPoet\Newsletter\AutomatedLatestContent(), new WPFunctions);
$response = $endpoint ->getPostTypes();
// WP's default post type 'revision' is excluded from search
// https://codex.wordpress.org/Post_Types