From 9a4ec9f5ea24c51ac889b4913d68169c85bcf86b Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Mon, 29 Nov 2021 11:49:32 +0400 Subject: [PATCH] Fix 'is_custom' assertions in PHPUnit tests --- .../phpunit/tests/rest-api/wpRestTemplatesController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/tests/rest-api/wpRestTemplatesController.php b/tests/phpunit/tests/rest-api/wpRestTemplatesController.php index 0ca61ec29f1e..c7720b608280 100644 --- a/tests/phpunit/tests/rest-api/wpRestTemplatesController.php +++ b/tests/phpunit/tests/rest-api/wpRestTemplatesController.php @@ -102,7 +102,7 @@ public function test_get_items() { 'status' => 'publish', 'wp_id' => self::$post->ID, 'has_theme_file' => false, - 'is_custom' => false, + 'is_custom' => true, 'author' => 0, ), $this->find_and_normalize_template_by_id( $data, 'default//my_template' ) @@ -146,7 +146,7 @@ public function test_get_item() { 'status' => 'publish', 'wp_id' => self::$post->ID, 'has_theme_file' => false, - 'is_custom' => false, + 'is_custom' => true, 'author' => 0, ), $data @@ -305,6 +305,7 @@ public function test_create_item_raw() { ), 'status' => 'publish', 'has_theme_file' => false, + 'is_custom' => true, 'author' => self::$admin_id, ), $data @@ -461,7 +462,7 @@ public function test_get_item_schema() { $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); $properties = $data['schema']['properties']; - $this->assertCount( 13, $properties ); + $this->assertCount( 14, $properties ); $this->assertArrayHasKey( 'id', $properties ); $this->assertArrayHasKey( 'description', $properties ); $this->assertArrayHasKey( 'slug', $properties ); @@ -475,6 +476,7 @@ public function test_get_item_schema() { $this->assertArrayHasKey( 'status', $properties ); $this->assertArrayHasKey( 'wp_id', $properties ); $this->assertArrayHasKey( 'has_theme_file', $properties ); + $this->assertArrayHasKey( 'is_custom', $properties ); $this->assertArrayHasKey( 'author', $properties ); }