diff --git a/tests/phpunit/tests/theme.php b/tests/phpunit/tests/theme.php index ac0eebb77a9e5..b1e51bc24fefe 100644 --- a/tests/phpunit/tests/theme.php +++ b/tests/phpunit/tests/theme.php @@ -6,9 +6,9 @@ * @group themes */ class Tests_Theme extends WP_UnitTestCase { - protected $theme_slug = 'twentyeleven'; - protected $theme_name = 'Twenty Eleven'; - protected $default_themes = array( + protected $theme_slug = 'twentyeleven'; + protected $theme_name = 'Twenty Eleven'; + protected static $default_themes = array( 'twentyten', 'twentyeleven', 'twentytwelve', @@ -236,7 +236,7 @@ public function test_default_theme_in_default_theme_list() { if ( ! $latest_default_theme->exists() ) { $this->fail( 'No default themes are installed.' ); } - $this->assertContains( $latest_default_theme->get_stylesheet(), $this->default_themes ); + $this->assertContains( $latest_default_theme->get_stylesheet(), self::$default_themes ); } /** @@ -261,7 +261,7 @@ public function test_default_default_theme_list_match_in_test_suite_and_at_runti $default_themes = array_keys( $property->getValue() ); $default_themes = array_diff( $default_themes, array( 'default', 'classic' ) ); - $this->assertSameSets( $default_themes, $this->default_themes, 'Test suite default themes should match the runtime default themes.' ); + $this->assertSameSets( $default_themes, self::$default_themes, 'Test suite default themes should match the runtime default themes.' ); } /** @@ -309,7 +309,7 @@ static function ( $file ) { } ); - $tested_themes = $this->default_themes; + $tested_themes = self::$default_themes; // Convert the tested themes to directory names. $tested_themes = array_map( static function ( $theme ) { @@ -322,7 +322,7 @@ static function ( $theme ) { } public function test_default_themes_have_textdomain() { - foreach ( $this->default_themes as $theme ) { + foreach ( self::$default_themes as $theme ) { if ( wp_get_theme( $theme )->exists() ) { $this->assertSame( $theme, wp_get_theme( $theme )->get( 'TextDomain' ) ); } @@ -359,9 +359,9 @@ public function test_year_in_readme( $theme ) { * * @return array */ - public function data_provider_default_themes(): array { + public static function data_provider_default_themes(): array { $data = array(); - foreach ( $this->default_themes as $default_theme ) { + foreach ( self::$default_themes as $default_theme ) { $data[ $default_theme ] = array( 'theme' => $default_theme ); } return $data;