Skip to content

Commit

Permalink
test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta committed Jan 25, 2024
1 parent a6701a9 commit a889d00
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/phpunit/tests/rest-api/wpRestTemplatesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ public function test_get_items() {
'is_custom' => true,
'author' => 0,
'modified' => mysql_to_rfc3339( self::$post->post_modified ),
'author_text' => 'Test Blog',
'original_source' => 'site',
),
$this->find_and_normalize_template_by_id( $data, 'default//my_template' )
);
Expand Down Expand Up @@ -164,6 +166,8 @@ public function test_get_item() {
'is_custom' => true,
'author' => 0,
'modified' => mysql_to_rfc3339( self::$post->post_modified ),
'author_text' => 'Test Blog',
'original_source' => 'site',
),
$data
);
Expand Down Expand Up @@ -201,6 +205,8 @@ public function test_get_item_works_with_a_single_slash( $endpoint_url ) {
'is_custom' => true,
'author' => 0,
'modified' => mysql_to_rfc3339( self::$post->post_modified ),
'author_text' => 'Test Blog',
'original_source' => 'site',
),
$data
);
Expand Down Expand Up @@ -241,6 +247,7 @@ public function test_get_item_with_valid_theme_dirname( $theme_dir, $template, a
$data = $response->get_data();
unset( $data['content'] );
unset( $data['_links'] );
$author_name = get_user_by( 'id', self::$admin_id )->get( 'display_name' );

$this->assertSameSetsWithIndex(
array(
Expand All @@ -261,6 +268,8 @@ public function test_get_item_with_valid_theme_dirname( $theme_dir, $template, a
'is_custom' => true,
'author' => self::$admin_id,
'modified' => mysql_to_rfc3339( $post->post_modified ),
'author_text' => $author_name,
'original_source' => 'user',
),
$data
);
Expand Down Expand Up @@ -442,6 +451,8 @@ public function test_create_item() {
'is_custom' => true,
'author' => self::$admin_id,
'modified' => mysql_to_rfc3339( $modified ),
'author_text' => 'Test Blog',
'original_source' => 'site',
),
$data
);
Expand Down Expand Up @@ -490,6 +501,8 @@ public function test_create_item_with_numeric_slug() {
'is_custom' => false,
'author' => self::$admin_id,
'modified' => mysql_to_rfc3339( $modified ),
'author_text' => 'Test Blog',
'original_source' => 'site',
),
$data
);
Expand Down Expand Up @@ -542,6 +555,8 @@ public function test_create_item_raw() {
'is_custom' => true,
'author' => self::$admin_id,
'modified' => mysql_to_rfc3339( $modified ),
'author_text' => 'Test Blog',
'original_source' => 'site',
),
$data
);
Expand Down

0 comments on commit a889d00

Please sign in to comment.