Skip to content
Closed
Changes from all commits
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
18 changes: 9 additions & 9 deletions tests/phpunit/tests/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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 );
}

/**
Expand All @@ -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.' );
}

/**
Expand Down Expand Up @@ -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 ) {
Expand All @@ -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' ) );
}
Expand Down Expand Up @@ -359,9 +359,9 @@ public function test_year_in_readme( $theme ) {
*
* @return array<string, array{ theme: string }>
*/
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;
Expand Down
Loading