summaryrefslogtreecommitdiffstats
path: root/tests/startsessionlistener.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-03-13 16:19:17 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-03-13 16:19:17 +0100
commitfc697c729811e5644e2c7bc884bd54d3ff092ac8 (patch)
tree9b8490d8ee138f2325bc6c3341706924133cb77a /tests/startsessionlistener.php
parent9fe5033f1ec1737eae9402008c5228e5fe60f9bc (diff)
downloadnextcloud-server-fc697c729811e5644e2c7bc884bd54d3ff092ac8.tar.gz
nextcloud-server-fc697c729811e5644e2c7bc884bd54d3ff092ac8.zip
adding StartSessionListener which initializes the session before each test case execution
Diffstat (limited to 'tests/startsessionlistener.php')
-rw-r--r--tests/startsessionlistener.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/startsessionlistener.php b/tests/startsessionlistener.php
new file mode 100644
index 00000000000..fb7fa83e090
--- /dev/null
+++ b/tests/startsessionlistener.php
@@ -0,0 +1,45 @@
+<?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) {
+ }
+
+}