Skip to content

Commit

Permalink
Update php rest API tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta committed Aug 19, 2021
1 parent d32ffb5 commit 1294b29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ public function get_item_schema() {
'context' => array( 'embed', 'view', 'edit' ),
'readonly' => true,
),
'author' => array(
'author' => array(
'description' => __( 'Template author', 'gutenberg' ),
'type' => 'integer',
'context' => array( 'embed', 'view', 'edit' ),
Expand Down
6 changes: 6 additions & 0 deletions phpunit/class-gutenberg-rest-template-controller-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ function find_and_normalize_template_by_id( $templates, $id ) {
'type' => 'wp_template',
'wp_id' => null,
'has_theme_file' => true,
'author' => null,
),
find_and_normalize_template_by_id( $data, 'tt1-blocks//index' )
);
Expand All @@ -101,6 +102,7 @@ function find_and_normalize_template_by_id( $templates, $id ) {
'wp_id' => null,
'area' => WP_TEMPLATE_PART_AREA_HEADER,
'has_theme_file' => true,
'author' => null,
),
find_and_normalize_template_by_id( $data, 'tt1-blocks//header' )
);
Expand Down Expand Up @@ -129,6 +131,7 @@ public function test_get_item() {
'type' => 'wp_template',
'wp_id' => null,
'has_theme_file' => true,
'author' => null,
),
$data
);
Expand All @@ -155,6 +158,7 @@ public function test_get_item() {
'wp_id' => null,
'area' => WP_TEMPLATE_PART_AREA_HEADER,
'has_theme_file' => true,
'author' => null,
),
$data
);
Expand Down Expand Up @@ -193,6 +197,7 @@ public function test_create_item() {
'raw' => 'Content',
),
'has_theme_file' => false,
'author' => 2,
),
$data
);
Expand Down Expand Up @@ -231,6 +236,7 @@ public function test_create_item() {
),
'area' => 'header',
'has_theme_file' => false,
'author' => 2,
),
$data
);
Expand Down

0 comments on commit 1294b29

Please sign in to comment.