Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add unit test for page templates
  • Loading branch information
oandregal committed Feb 5, 2021
commit 854502457aa48ee9edb7af59a16cfa736b53460d
18 changes: 18 additions & 0 deletions phpunit/class-wp-theme-json-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -736,4 +736,22 @@ function test_remove_insecure_properties_removes_unsafe_preset_settings() {
);
$this->assertEqualSetsWithIndex( $expected, $result );
}

function test_get_page_templates() {
$theme_json = new WP_Theme_JSON( array(
'pageTemplates' => array(
'page-home' => array(
'title' => 'Some title'
),
),
) );

$page_templates = $theme_json->get_page_templates();

$this->assertEqualSetsWithIndex( $page_templates, array(
'page-home' => array(
'title' => 'Some title',
),
) );
}
}