mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Fixed SSViewerTest->testCurrentTheme() not to rely on SiteConfig
This commit is contained in:
parent
eb221ca821
commit
251c1df63a
@ -8,26 +8,9 @@ class SSViewerTest extends SapphireTest {
|
|||||||
* when no user themes are defined.
|
* when no user themes are defined.
|
||||||
*/
|
*/
|
||||||
function testCurrentTheme() {
|
function testCurrentTheme() {
|
||||||
$config = SiteConfig::current_site_config();
|
//TODO: SiteConfig moved to CMS
|
||||||
$oldTheme = $config->Theme;
|
|
||||||
$config->Theme = '';
|
|
||||||
$config->write();
|
|
||||||
|
|
||||||
SSViewer::set_theme('mytheme');
|
SSViewer::set_theme('mytheme');
|
||||||
$this->assertEquals('mytheme', SSViewer::current_theme(), 'Current theme is the default - user has not defined one');
|
$this->assertEquals('mytheme', SSViewer::current_theme(), 'Current theme is the default - user has not defined one');
|
||||||
|
|
||||||
$config->Theme = 'myusertheme';
|
|
||||||
$config->write();
|
|
||||||
|
|
||||||
// Pretent to load the page
|
|
||||||
$c = new ContentController();
|
|
||||||
$c->handleRequest(new SS_HTTPRequest('GET', '/'));
|
|
||||||
|
|
||||||
$this->assertEquals('myusertheme', SSViewer::current_theme(), 'Current theme is a user defined one');
|
|
||||||
|
|
||||||
// Set the theme back to the original
|
|
||||||
$config->Theme = $oldTheme;
|
|
||||||
$config->write();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -592,3 +575,8 @@ class SSViewerTest_ViewableData extends ViewableData implements TestOnly {
|
|||||||
return "arg1:{$arg1},arg2:{$arg2}";
|
return "arg1:{$arg1},arg2:{$arg2}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class SSViewerTest_Controller extends Controller {
|
||||||
|
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user