From 393940195d5821b42e4acb4465f9bed732f76908 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Mon, 30 Sep 2024 18:08:11 +1300 Subject: [PATCH] MNT Fix unit test (#603) --- tests/php/Service/ThemeResolverTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/php/Service/ThemeResolverTest.php b/tests/php/Service/ThemeResolverTest.php index 67eea1b8..04720ac1 100644 --- a/tests/php/Service/ThemeResolverTest.php +++ b/tests/php/Service/ThemeResolverTest.php @@ -11,7 +11,7 @@ class ThemeResolverTest extends SapphireTest { - protected $themeList = [ + protected static array $themeList = [ '$public', 'custom', 'main', @@ -24,7 +24,7 @@ protected function setUp(): void parent::setUp(); // Setup known theme config - Config::modify()->set(SSViewer::class, 'themes', $this->themeList); + Config::modify()->set(SSViewer::class, 'themes', static::$themeList); } public function testSubsiteWithoutThemeReturnsDefaultThemeList() @@ -32,7 +32,7 @@ public function testSubsiteWithoutThemeReturnsDefaultThemeList() $subsite = new Subsite(); $resolver = new ThemeResolver(); - $this->assertSame($this->themeList, $resolver->getThemeList($subsite)); + $this->assertSame(static::$themeList, $resolver->getThemeList($subsite)); } public function testSubsiteWithCustomThemePrependsToList() @@ -42,7 +42,7 @@ public function testSubsiteWithCustomThemePrependsToList() $resolver = new ThemeResolver(); - $expected = array_merge(['subsite'], $this->themeList); + $expected = array_merge(['subsite'], static::$themeList); $this->assertSame($expected, $resolver->getThemeList($subsite)); } @@ -135,7 +135,7 @@ public static function customThemeDefinitionsAreRespectedProvider() SSViewer::DEFAULT_THEME, ]], 'other', - array_merge(['other'], $this->themeList) + array_merge(['other'], static::$themeList) ], ]; }