]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/front/controller/admin/LogoutControllerTest.php
Use multi-level routes for existing controllers instead of 1 level everywhere
[github/shaarli/Shaarli.git] / tests / front / controller / admin / LogoutControllerTest.php
index 239e39b2dd50067720ee80baff4bf5339842b9ea..ca177085e7734112fd68c090e50b0822e654b6bf 100644 (file)
@@ -5,7 +5,7 @@ declare(strict_types=1);
 namespace Shaarli\Front\Controller\Admin;
 
 /** Override PHP builtin setcookie function in the local namespace to mock it... more or less */
-if (!function_exists('Shaarli\Front\Controller\setcookie')) {
+if (!function_exists('Shaarli\Front\Controller\Admin\setcookie')) {
     function setcookie(string $name, string $value): void {
         $_COOKIE[$name] = $value;
     }
@@ -35,8 +35,6 @@ class LogoutControllerTest extends TestCase
 
     public function testValidControllerInvoke(): void
     {
-        $this->createValidContainerMockSet();
-
         $request = $this->createMock(Request::class);
         $response = new Response();
 
@@ -51,7 +49,7 @@ class LogoutControllerTest extends TestCase
 
         static::assertInstanceOf(Response::class, $result);
         static::assertSame(302, $result->getStatusCode());
-        static::assertContains('./', $result->getHeader('Location'));
+        static::assertSame(['/subfolder/'], $result->getHeader('location'));
         static::assertSame('false', $_COOKIE[LoginManager::$STAY_SIGNED_IN_COOKIE]);
     }
 }