Prevents excluded post types from being displayed in newsletter editor

This commit is contained in:
Vlad
2017-09-25 19:45:33 -04:00
parent 7551fff93f
commit 119e574495
2 changed files with 12 additions and 1 deletions

View File

@ -15,4 +15,14 @@ class AutomatedLatestContentTest extends \MailPoetTest {
expect($post_type['label'])->notEmpty();
}
}
function testItDoesNotGetPostTypesExludedFromSearch() {
$router = new AutomatedLatestContent();
$response = $router->getPostTypes();
// WP's default post type 'revision' is excluded from search
// https://codex.wordpress.org/Post_Types
$revision_post_type = get_post_type_object('revision');
expect($revision_post_type->exclude_from_search)->true();
expect(isset($response->data['revision']))->false();
}
}