mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-05 07:07:04 +00:00
Tests: Use shared fixtures in block theme tests.
This removes duplicate test data and aims to avoid future confusion about which themes to use in which tests. Follow-up to [52049], [52246], [52247], [52279]. See #53363. git-svn-id: https://develop.svn.wordpress.org/trunk@52391 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -163,8 +163,6 @@ class Tests_Theme_ThemeDir extends WP_UnitTestCase {
|
||||
'REST Theme',
|
||||
'Block Theme',
|
||||
'Block Theme Child Theme',
|
||||
'Test Block Theme',
|
||||
'Test Block Child Theme',
|
||||
);
|
||||
|
||||
sort( $theme_names );
|
||||
|
||||
@@ -273,11 +273,11 @@ class Tests_Theme_wpTheme extends WP_UnitTestCase {
|
||||
'expected' => false,
|
||||
),
|
||||
'parent block theme' => array(
|
||||
'theme_dir' => 'test-block-theme',
|
||||
'theme_dir' => 'block-theme',
|
||||
'expected' => true,
|
||||
),
|
||||
'child block theme' => array(
|
||||
'theme_dir' => 'test-block-child-theme',
|
||||
'theme_dir' => 'block-theme-child',
|
||||
'expected' => true,
|
||||
),
|
||||
);
|
||||
@@ -312,14 +312,14 @@ class Tests_Theme_wpTheme extends WP_UnitTestCase {
|
||||
'expected' => '/nonexistent',
|
||||
),
|
||||
'parent theme: no file given' => array(
|
||||
'theme_dir' => 'test-block-theme',
|
||||
'theme_dir' => 'block-theme',
|
||||
'file' => '',
|
||||
'expected' => '/test-block-theme',
|
||||
'expected' => '/block-theme',
|
||||
),
|
||||
'child theme: no file given' => array(
|
||||
'theme_dir' => 'test-block-child-theme',
|
||||
'theme_dir' => 'block-theme-child',
|
||||
'file' => '',
|
||||
'expected' => '/test-block-child-theme',
|
||||
'expected' => '/block-theme-child',
|
||||
),
|
||||
'nonexistent theme: file given' => array(
|
||||
'theme_dir' => 'nonexistent',
|
||||
@@ -327,29 +327,29 @@ class Tests_Theme_wpTheme extends WP_UnitTestCase {
|
||||
'expected' => '/nonexistent/templates/page.html',
|
||||
),
|
||||
'parent theme: file exists' => array(
|
||||
'theme_dir' => 'test-block-theme',
|
||||
'theme_dir' => 'block-theme',
|
||||
'file' => '/templates/page-home.html',
|
||||
'expected' => '/test-block-theme/templates/page-home.html',
|
||||
'expected' => '/block-theme/templates/page-home.html',
|
||||
),
|
||||
'parent theme: file does not exist' => array(
|
||||
'theme_dir' => 'test-block-theme',
|
||||
'theme_dir' => 'block-theme',
|
||||
'file' => '/templates/nonexistent.html',
|
||||
'expected' => '/test-block-theme/templates/nonexistent.html',
|
||||
'expected' => '/block-theme/templates/nonexistent.html',
|
||||
),
|
||||
'child theme: file exists' => array(
|
||||
'theme_dir' => 'test-block-child-theme',
|
||||
'theme_dir' => 'block-theme-child',
|
||||
'file' => '/templates/page-1.html',
|
||||
'expected' => '/test-block-child-theme/templates/page-1.html',
|
||||
'expected' => '/block-theme-child/templates/page-1.html',
|
||||
),
|
||||
'child theme: file does not exist' => array(
|
||||
'theme_dir' => 'test-block-child-theme',
|
||||
'theme_dir' => 'block-theme-child',
|
||||
'file' => '/templates/nonexistent.html',
|
||||
'expected' => '/test-block-theme/templates/nonexistent.html',
|
||||
'expected' => '/block-theme/templates/nonexistent.html',
|
||||
),
|
||||
'child theme: file exists in parent, not in child' => array(
|
||||
'theme_dir' => 'test-block-child-theme',
|
||||
'theme_dir' => 'block-theme-child',
|
||||
'file' => '/templates/page.html',
|
||||
'expected' => '/test-block-theme/templates/page.html',
|
||||
'expected' => '/block-theme/templates/page.html',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user