Skip to content

Commit

Permalink
Fix the failing PHPUnit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-vlasenko committed Jan 15, 2025
1 parent fa48424 commit fd60b44
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
20 changes: 18 additions & 2 deletions tests/phpunit/tests/rest-api/wpRestTemplateRevisionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
),
);
}
Expand Down

0 comments on commit fd60b44

Please sign in to comment.