mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
MNT Fix unit test (#603)
This commit is contained in:
parent
06d9a713e5
commit
393940195d
@ -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)
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user