From 8aaaacc23cb74480b054c6572cb5684159c7a2b4 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 4 Mar 2014 17:49:41 +1300 Subject: [PATCH] Fixed regression on file paths in manual test sessions --- code/TestSessionEnvironment.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/TestSessionEnvironment.php b/code/TestSessionEnvironment.php index 7ee33ba..467f9a3 100644 --- a/code/TestSessionEnvironment.php +++ b/code/TestSessionEnvironment.php @@ -166,6 +166,7 @@ class TestSessionEnvironment extends Object { if(!isset($state->$k)) $state->$k = $v; // Don't overwrite stuff in $state, as that's the new state } } + if(isset($state->database) && $state->database) { if(!DB::getConn()) { // No connection, so try and connect to tmpdb if it exists @@ -377,7 +378,7 @@ class TestSessionEnvironment extends Object { * @return stdClass Data as taken from the JSON object in {@link self::loadFromFile()} */ public function getState() { - $path = Director::getAbsFile($this->config()->test_state_file); + $path = Director::getAbsFile($this->getFilePath()); return (file_exists($path)) ? json_decode(file_get_contents($path)) : new stdClass; } } \ No newline at end of file