25 lines
596 B
PHP
25 lines
596 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Tests\Controller;
|
||
|
|
|
||
|
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||
|
|
|
||
|
|
class RedirectControllerTest extends WebTestCase
|
||
|
|
{
|
||
|
|
public function testNoUrlRedirectsToHome(): void
|
||
|
|
{
|
||
|
|
$client = static::createClient();
|
||
|
|
$client->request('GET', '/external-redirect');
|
||
|
|
|
||
|
|
self::assertResponseRedirects('/');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function testWithUrlRendersWarningPage(): void
|
||
|
|
{
|
||
|
|
$client = static::createClient();
|
||
|
|
$client->request('GET', '/external-redirect?redirUrl=https://example.com');
|
||
|
|
|
||
|
|
self::assertResponseIsSuccessful();
|
||
|
|
}
|
||
|
|
}
|