Skip to content

Commit

Permalink
Fix 'is_custom' assertions in PHPUnit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored and noisysocks committed Nov 29, 2021
1 parent fa3f5c7 commit 9a4ec9f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/phpunit/tests/rest-api/wpRestTemplatesController.php
Expand Up @@ -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' )
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -305,6 +305,7 @@ public function test_create_item_raw() {
),
'status' => 'publish',
'has_theme_file' => false,
'is_custom' => true,
'author' => self::$admin_id,
),
$data
Expand Down Expand Up @@ -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 );
Expand All @@ -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 );
}

Expand Down

0 comments on commit 9a4ec9f

Please sign in to comment.