From 251c1df63a820bdf8bf82f37a36c9c2060895362 Mon Sep 17 00:00:00 2001 From: Paul Meyrick Date: Fri, 18 Mar 2011 15:04:43 +1300 Subject: [PATCH] MINOR Fixed SSViewerTest->testCurrentTheme() not to rely on SiteConfig --- tests/SSViewerTest.php | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/tests/SSViewerTest.php b/tests/SSViewerTest.php index f4ecef103..3fe08bbcf 100644 --- a/tests/SSViewerTest.php +++ b/tests/SSViewerTest.php @@ -8,26 +8,9 @@ class SSViewerTest extends SapphireTest { * when no user themes are defined. */ function testCurrentTheme() { - $config = SiteConfig::current_site_config(); - $oldTheme = $config->Theme; - $config->Theme = ''; - $config->write(); - + //TODO: SiteConfig moved to CMS SSViewer::set_theme('mytheme'); $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}"; } } + + +class SSViewerTest_Controller extends Controller { + +}