Merge pull request #1084 from mailpoet/editor_get_post_type_optimization

Removes unused properties from the object used to display post types in editor [MAILPOET-1086]
This commit is contained in:
Tautvidas Sipavičius
2017-09-05 17:43:27 +03:00
committed by GitHub
2 changed files with 26 additions and 2 deletions

View File

@ -0,0 +1,18 @@
<?php
namespace MailPoet\Test\API\JSON\v1;
use MailPoet\API\JSON\v1\AutomatedLatestContent;
class AutomatedLatestContentTest extends \MailPoetTest {
function testItGetsPostTypes() {
$router = new AutomatedLatestContent();
$response = $router->getPostTypes();
expect($response->data)->notEmpty();
foreach($response->data as $post_type) {
expect($post_type)->count(2);
expect($post_type['name'])->notEmpty();
expect($post_type['label'])->notEmpty();
}
}
}