summaryrefslogtreecommitdiffstats
path: root/tests/lib/AppFramework/Middleware/SessionMiddlewareTest.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-07-26 10:50:39 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2017-07-31 16:54:19 +0200
commitf71dc7523f7625da4c47ec9d5b116d20f71dba33 (patch)
treed8992481a5f8b043ac010986fed8eb7eaf3ce3db /tests/lib/AppFramework/Middleware/SessionMiddlewareTest.php
parent3548603a88360f9577a386c3b9c2032230c48632 (diff)
downloadnextcloud-server-f71dc7523f7625da4c47ec9d5b116d20f71dba33.tar.gz
nextcloud-server-f71dc7523f7625da4c47ec9d5b116d20f71dba33.zip
Fix tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests/lib/AppFramework/Middleware/SessionMiddlewareTest.php')
-rw-r--r--tests/lib/AppFramework/Middleware/SessionMiddlewareTest.php21
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/lib/AppFramework/Middleware/SessionMiddlewareTest.php b/tests/lib/AppFramework/Middleware/SessionMiddlewareTest.php
index af2045cb7c1..3c218bb53c7 100644
--- a/tests/lib/AppFramework/Middleware/SessionMiddlewareTest.php
+++ b/tests/lib/AppFramework/Middleware/SessionMiddlewareTest.php
@@ -15,21 +15,21 @@ namespace Test\AppFramework\Middleware;
use OC\AppFramework\Http\Request;
use OC\AppFramework\Middleware\SessionMiddleware;
use OC\AppFramework\Utility\ControllerMethodReflector;
+use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\Response;
class SessionMiddlewareTest extends \Test\TestCase {
- /**
- * @var ControllerMethodReflector
- */
+ /** @var ControllerMethodReflector */
private $reflector;
- /**
- * @var Request
- */
+ /** @var Request */
private $request;
+ /** @var Controller */
+ private $controller;
+
protected function setUp() {
parent::setUp();
@@ -39,6 +39,7 @@ class SessionMiddlewareTest extends \Test\TestCase {
$this->getMockBuilder('\OCP\IConfig')->getMock()
);
$this->reflector = new ControllerMethodReflector();
+ $this->controller = $this->createMock(Controller::class);
}
/**
@@ -49,7 +50,7 @@ class SessionMiddlewareTest extends \Test\TestCase {
$this->reflector->reflect($this, __FUNCTION__);
$middleware = new SessionMiddleware($this->request, $this->reflector, $session);
- $middleware->beforeController($this, __FUNCTION__);
+ $middleware->beforeController($this->controller, __FUNCTION__);
}
/**
@@ -60,7 +61,7 @@ class SessionMiddlewareTest extends \Test\TestCase {
$this->reflector->reflect($this, __FUNCTION__);
$middleware = new SessionMiddleware($this->request, $this->reflector, $session);
- $middleware->afterController($this, __FUNCTION__, new Response());
+ $middleware->afterController($this->controller, __FUNCTION__, new Response());
}
public function testSessionClosedOnBeforeController() {
@@ -68,7 +69,7 @@ class SessionMiddlewareTest extends \Test\TestCase {
$this->reflector->reflect($this, __FUNCTION__);
$middleware = new SessionMiddleware($this->request, $this->reflector, $session);
- $middleware->beforeController($this, __FUNCTION__);
+ $middleware->beforeController($this->controller, __FUNCTION__);
}
public function testSessionNotClosedOnAfterController() {
@@ -76,7 +77,7 @@ class SessionMiddlewareTest extends \Test\TestCase {
$this->reflector->reflect($this, __FUNCTION__);
$middleware = new SessionMiddleware($this->request, $this->reflector, $session);
- $middleware->afterController($this, __FUNCTION__, new Response());
+ $middleware->afterController($this->controller, __FUNCTION__, new Response());
}
/**