From 2b793bf242d05b416530c01ede508dcb06f32e5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 2 Jul 2023 17:46:09 +0200 Subject: [PATCH] Fixed tests --- src/Controller/ScanController.php | 2 +- tests/Controller/ScanControllerTest.php | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Controller/ScanController.php b/src/Controller/ScanController.php index fc575b50..b261f3fd 100644 --- a/src/Controller/ScanController.php +++ b/src/Controller/ScanController.php @@ -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'); diff --git a/tests/Controller/ScanControllerTest.php b/tests/Controller/ScanControllerTest.php index deb1311c..5226e69b 100644 --- a/tests/Controller/ScanControllerTest.php +++ b/tests/Controller/ScanControllerTest.php @@ -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'); }