Make Redirect helper supports only absolute path reference URLs

This commit is contained in:
Yassine Guedidi
2023-12-28 21:26:10 +01:00
parent 7ebc96f3b9
commit 9bef459882
2 changed files with 23 additions and 3 deletions

View File

@ -73,6 +73,13 @@ class RedirectTest extends TestCase
$this->assertSame('/unread/list', $redirectUrl);
}
public function testRedirectToAbsoluteUrl()
{
$redirectUrl = $this->redirect->to('https://www.google.com/');
$this->assertSame('/', $redirectUrl);
}
public function testWithNotLoggedUser()
{
$redirect = new Redirect($this->routerMock, new TokenStorage());