diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-03-17 21:57:10 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-03-17 21:57:10 +0100 |
commit | 6bbbf8536f6d5d21eed906c42da1e12118e4112e (patch) | |
tree | 825b568ded0675360a34d085c6101e2ede0d7fbd /tests/startsessionlistener.php | |
parent | bbbbb033f32353ef1582a6f90305c4ad01e2390a (diff) | |
download | nextcloud-server-6bbbf8536f6d5d21eed906c42da1e12118e4112e.tar.gz nextcloud-server-6bbbf8536f6d5d21eed906c42da1e12118e4112e.zip |
introduce reopen() method to be used for unit test execution only - right after a unit test has been executed the session will be reopened
Diffstat (limited to 'tests/startsessionlistener.php')
-rw-r--r-- | tests/startsessionlistener.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/startsessionlistener.php b/tests/startsessionlistener.php index 7559b8cff65..808a2a2226f 100644 --- a/tests/startsessionlistener.php +++ b/tests/startsessionlistener.php @@ -27,11 +27,12 @@ class StartSessionListener implements PHPUnit_Framework_TestListener { } public function endTest(PHPUnit_Framework_Test $test, $time) { - // new session - \OC::$session = new \OC\Session\Memory(''); - - // load the version - OC_Util::getVersion(); + // reopen the session - only allowed for memory session + if (\OC::$session instanceof \OC\Session\Memory) { + /** @var $session \OC\Session\Memory */ + $session = \OC::$session; + $session->reopen(); + } } public function startTestSuite(PHPUnit_Framework_TestSuite $suite) { |