From 52983712829fe994bc17575167202bf899ea5353 Mon Sep 17 00:00:00 2001 From: Daniel Hensby Date: Fri, 2 May 2014 15:25:31 +0100 Subject: [PATCH] Use Config nesting in `SapphireTest::useTestTheme()` Using the Config nesting functionality to restore variables --- dev/SapphireTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dev/SapphireTest.php b/dev/SapphireTest.php index 81d67f499..61687220e 100644 --- a/dev/SapphireTest.php +++ b/dev/SapphireTest.php @@ -895,13 +895,13 @@ class SapphireTest extends PHPUnit_Framework_TestCase { * @param $callback Closure */ protected function useTestTheme($themeBaseDir, $theme, $callback) { + Config::nest(); global $project; $manifest = new SS_TemplateManifest($themeBaseDir, $project, true, true); SS_TemplateLoader::instance()->pushManifest($manifest); - $origTheme = Config::inst()->get('SSViewer', 'theme'); Config::inst()->update('SSViewer', 'theme', $theme); $e = null; @@ -911,7 +911,8 @@ class SapphireTest extends PHPUnit_Framework_TestCase { // Remove all the test themes we created SS_TemplateLoader::instance()->popManifest(); - Config::inst()->update('SSViewer', 'theme', $origTheme); + + Config::unnest(); if ($e) throw $e; }