MNT Fix unit test (#603)

This commit is contained in:
Guy Sartorelli 2024-09-30 18:08:11 +13:00 committed by GitHub
parent 06d9a713e5
commit 393940195d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,7 +11,7 @@ use PHPUnit\Framework\Attributes\DataProvider;
class ThemeResolverTest extends SapphireTest class ThemeResolverTest extends SapphireTest
{ {
protected $themeList = [ protected static array $themeList = [
'$public', '$public',
'custom', 'custom',
'main', 'main',
@ -24,7 +24,7 @@ class ThemeResolverTest extends SapphireTest
parent::setUp(); parent::setUp();
// Setup known theme config // Setup known theme config
Config::modify()->set(SSViewer::class, 'themes', $this->themeList); Config::modify()->set(SSViewer::class, 'themes', static::$themeList);
} }
public function testSubsiteWithoutThemeReturnsDefaultThemeList() public function testSubsiteWithoutThemeReturnsDefaultThemeList()
@ -32,7 +32,7 @@ class ThemeResolverTest extends SapphireTest
$subsite = new Subsite(); $subsite = new Subsite();
$resolver = new ThemeResolver(); $resolver = new ThemeResolver();
$this->assertSame($this->themeList, $resolver->getThemeList($subsite)); $this->assertSame(static::$themeList, $resolver->getThemeList($subsite));
} }
public function testSubsiteWithCustomThemePrependsToList() public function testSubsiteWithCustomThemePrependsToList()
@ -42,7 +42,7 @@ class ThemeResolverTest extends SapphireTest
$resolver = new ThemeResolver(); $resolver = new ThemeResolver();
$expected = array_merge(['subsite'], $this->themeList); $expected = array_merge(['subsite'], static::$themeList);
$this->assertSame($expected, $resolver->getThemeList($subsite)); $this->assertSame($expected, $resolver->getThemeList($subsite));
} }
@ -135,7 +135,7 @@ class ThemeResolverTest extends SapphireTest
SSViewer::DEFAULT_THEME, SSViewer::DEFAULT_THEME,
]], ]],
'other', 'other',
array_merge(['other'], $this->themeList) array_merge(['other'], static::$themeList)
], ],
]; ];
} }