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;
}
public function testValidControllerInvoke(): void
{
- $this->createValidContainerMockSet();
-
$request = $this->createMock(Request::class);
$response = new Response();
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]);
}
}