Skip to content
Snippets Groups Projects
Commit 6bbbf853 authored by Thomas Müller's avatar Thomas Müller
Browse files

introduce reopen() method to be used for unit test execution only - right...

introduce reopen() method to be used for unit test execution only - right after a unit test has been executed the session will be reopened
parent bbbbb033
Branches
No related tags found
No related merge requests found
......@@ -63,6 +63,13 @@ class Memory extends Session {
$this->data = array();
}
/**
* Helper function for PHPUnit execution - don't use in non-test code
*/
public function reopen() {
$this->sessionClosed = false;
}
/**
* In case the session has already been locked an exception will be thrown
*
......
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment