aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/front/ShaarliMiddlewareTest.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-07-21 20:33:33 +0200
committerArthurHoaro <arthur@hoa.ro>2020-07-23 21:19:21 +0200
commita8c11451e8d885a243c1ad52012093ba8d121e2c (patch)
tree19caf0ed75f5b26c34f3f979f2b95d3f1232dbae /tests/front/ShaarliMiddlewareTest.php
parentc4ad3d4f061d05a01db25aa54dda830ba776792d (diff)
downloadShaarli-a8c11451e8d885a243c1ad52012093ba8d121e2c.tar.gz
Shaarli-a8c11451e8d885a243c1ad52012093ba8d121e2c.tar.zst
Shaarli-a8c11451e8d885a243c1ad52012093ba8d121e2c.zip
Process login through Slim controller
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 /**