Fixed tests

This commit is contained in:
Jan Böhmer 2023-07-02 17:46:09 +02:00
parent 49ae906029
commit 2b793bf242
2 changed files with 6 additions and 3 deletions

View file

@ -59,7 +59,7 @@ class ScanController extends AbstractController
{
}
#[Route(path: '/', name: 'scan_dialog')]
#[Route(path: '', name: 'scan_dialog')]
public function dialog(Request $request, #[MapQueryParameter] ?string $input = null): Response
{
$this->denyAccessUnlessGranted('@tools.label_scanner');

View file

@ -30,14 +30,17 @@ class ScanControllerTest extends WebTestCase
public function setUp(): void
{
$this->client = static::createClient();
$this->client = static::createClient([], [
'PHP_AUTH_USER' => 'admin',
'PHP_AUTH_PW' => 'test',
]);
$this->client->disableReboot();
$this->client->catchExceptions(false);
}
public function testRedirectOnInputParameter(): void
{
$this->client->request('GET', '/en/scan/?input=0000001');
$this->client->request('GET', '/en/scan?input=0000001');
$this->assertResponseRedirects('/en/part/1');
}