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

adding StartSessionListener which initializes the session before each test case execution

parent 9fe5033f
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,7 @@
</whitelist>
</filter>
<listeners>
<listener class="StartSessionListener" file="startsessionlistener.php" />
<listener class="TestCleanupListener" file="testcleanuplistener.php">
<arguments>
<string>detail</string>
......
......@@ -29,4 +29,7 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="StartSessionListener" file="startsessionlistener.php" />
</listeners>
</phpunit>
<?php
/**
* Copyright (c) 2014 Thomas Müller <deepdiver@owncloud.com>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
/**
* Starts a new session before each test execution
*/
class StartSessionListener implements PHPUnit_Framework_TestListener {
public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) {
}
public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) {
}
public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) {
}
public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) {
}
public function startTest(PHPUnit_Framework_Test $test) {
// new session
\OC::$session = new \OC\Session\Memory('');
// load the version
OC_Util::getVersion();
}
public function endTest(PHPUnit_Framework_Test $test, $time) {
}
public function startTestSuite(PHPUnit_Framework_TestSuite $suite) {
}
public function endTestSuite(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