1
0
Fork 0
get-installer-bootstrap/tests/Controller/HomeControllerTest.php

30 lines
784 B
PHP
Raw Normal View History

2026-05-05 08:28:06 +00:00
<?php
namespace App\Tests\Controller;
use App\Entity\AppSetting;
use App\Tests\DatabaseWebTestCase;
final class HomeControllerTest extends DatabaseWebTestCase
{
public function testRootRedirectsToAdminWhenNoRedirectUrlIsConfigured(): void
{
$this->client->request('GET', '/');
self::assertResponseRedirects('/admin');
}
public function testRootRedirectsToConfiguredUrl(): void
{
$setting = (new AppSetting())
->setName(AppSetting::ROOT_REDIRECT_URL)
->setValue('https://example.com/installers');
$this->entityManager->persist($setting);
$this->entityManager->flush();
$this->client->request('GET', '/');
self::assertResponseRedirects('https://example.com/installers');
}
}