aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/front/ShaarliMiddlewareTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/front/ShaarliMiddlewareTest.php')
-rw-r--r--tests/front/ShaarliMiddlewareTest.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/front/ShaarliMiddlewareTest.php b/tests/front/ShaarliMiddlewareTest.php
index 20090d8b..09bebd04 100644
--- a/tests/front/ShaarliMiddlewareTest.php
+++ b/tests/front/ShaarliMiddlewareTest.php
@@ -38,6 +38,8 @@ class ShaarliMiddlewareTest extends TestCase
38 38
39 $this->container->loginManager = $this->createMock(LoginManager::class); 39 $this->container->loginManager = $this->createMock(LoginManager::class);
40 40
41 $this->container->environment = ['REQUEST_URI' => 'http://shaarli/subfolder/path'];
42
41 $this->middleware = new ShaarliMiddleware($this->container); 43 $this->middleware = new ShaarliMiddleware($this->container);
42 } 44 }
43 45
@@ -127,7 +129,10 @@ class ShaarliMiddlewareTest extends TestCase
127 $result = $this->middleware->__invoke($request, $response, $controller); 129 $result = $this->middleware->__invoke($request, $response, $controller);
128 130
129 static::assertSame(302, $result->getStatusCode()); 131 static::assertSame(302, $result->getStatusCode());
130 static::assertSame('/subfolder/login', $result->getHeader('location')[0]); 132 static::assertSame(
133 '/subfolder/login?returnurl=' . urlencode('http://shaarli/subfolder/path'),
134 $result->getHeader('location')[0]
135 );
131 } 136 }
132 137
133 /** 138 /**