diff --git a/tests/phpunit/tests/rest-api/wpRestTemplateAutosavesController.php b/tests/phpunit/tests/rest-api/wpRestTemplateAutosavesController.php index 575a5980b31db..d5e9213517317 100644 --- a/tests/phpunit/tests/rest-api/wpRestTemplateAutosavesController.php +++ b/tests/phpunit/tests/rest-api/wpRestTemplateAutosavesController.php @@ -34,6 +34,11 @@ class Tests_REST_wpRestTemplateAutosavesController extends WP_Test_REST_Controll */ const TEMPLATE_PART_POST_TYPE = 'wp_template_part'; + /** + * @var string + */ + const PARENT_POST_TYPE = 'wp_template'; + /** * Admin user ID. * diff --git a/tests/phpunit/tests/rest-api/wpRestTemplateRevisionsController.php b/tests/phpunit/tests/rest-api/wpRestTemplateRevisionsController.php index a8800285f5be7..700d31360cc2e 100644 --- a/tests/phpunit/tests/rest-api/wpRestTemplateRevisionsController.php +++ b/tests/phpunit/tests/rest-api/wpRestTemplateRevisionsController.php @@ -715,17 +715,33 @@ public function test_get_item_invalid_parent_id( $parent_post_property_name, $ac */ public function data_get_item_invalid_parent_id() { return array( - 'templates' => array( + 'templates, GET request' => array( 'template_post', 'template_post_2', 'templates', self::TEST_THEME . '//' . self::TEMPLATE_NAME_2, + 'GET', ), - 'template parts' => array( + 'templates, HEAD request' => array( + 'template_post', + 'template_post_2', + 'templates', + self::TEST_THEME . '//' . self::TEMPLATE_NAME_2, + 'HEAD', + ), + 'template parts, GET request' => array( + 'template_part_post', + 'template_part_post_2', + 'template-parts', + self::TEST_THEME . '//' . self::TEMPLATE_PART_NAME_2, + 'GET', + ), + 'template parts, HEAD request' => array( 'template_part_post', 'template_part_post_2', 'template-parts', self::TEST_THEME . '//' . self::TEMPLATE_PART_NAME_2, + 'HEAD', ), ); }