From fae28b1fd7cce534c2a0cc1782dcce5d4b6a956e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Fri, 18 Sep 2026 09:38:35 +0200 Subject: [PATCH] fix: run the functional tests over https --- config/packages/security.yaml | 2 +- tests/Controller/Admin/BookingAdminControllerTest.php | 4 ++-- tests/Controller/Admin/ResourceAdminControllerTest.php | 2 +- tests/Controller/BookingControllerTest.php | 2 +- tests/Controller/DashboardControllerTest.php | 2 +- tests/Controller/FloorPlanTest.php | 2 +- tests/EventListener/HtmxErrorFlashListenerTest.php | 2 +- tests/Security/LoginEntryPointTest.php | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config/packages/security.yaml b/config/packages/security.yaml index e296825..4dcbd31 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -34,4 +34,4 @@ security: # ROLE_USER: myep authenticates far more people than work here, and someone who holds # neither of these is refused at login with an explanation rather than let in to an # empty screen. - - { path: ^/, roles: [ROLE_EMPLOYEE, ROLE_ADMIN], , requires_channel: https } + - { path: ^/, roles: [ROLE_EMPLOYEE, ROLE_ADMIN], requires_channel: https } diff --git a/tests/Controller/Admin/BookingAdminControllerTest.php b/tests/Controller/Admin/BookingAdminControllerTest.php index 336a254..cad82e4 100644 --- a/tests/Controller/Admin/BookingAdminControllerTest.php +++ b/tests/Controller/Admin/BookingAdminControllerTest.php @@ -26,7 +26,7 @@ class BookingAdminControllerTest extends WebTestCase protected function setUp(): void { - $this->client = self::createClient(); + $this->client = self::createClient(server: ['HTTPS' => true]); $this->client->disableReboot(); $this->em = self::getContainer()->get(EntityManagerInterface::class); $this->em->getConnection()->beginTransaction(); @@ -231,7 +231,7 @@ class BookingAdminControllerTest extends WebTestCase self::assertStringContainsString('Bea Berger', $modal->text()); // Posts back to the same URI, which is what carries ?return=admin through the round trip. self::assertSame( - \sprintf('http://localhost/bookings/%d/release?return=admin', $booking->getId()), + \sprintf('https://localhost/bookings/%d/release?return=admin', $booking->getId()), $modal->filter('[hx-post]')->attr('hx-post'), ); } diff --git a/tests/Controller/Admin/ResourceAdminControllerTest.php b/tests/Controller/Admin/ResourceAdminControllerTest.php index 2268613..70c80e7 100644 --- a/tests/Controller/Admin/ResourceAdminControllerTest.php +++ b/tests/Controller/Admin/ResourceAdminControllerTest.php @@ -27,7 +27,7 @@ class ResourceAdminControllerTest extends WebTestCase protected function setUp(): void { - $this->client = self::createClient(); + $this->client = self::createClient(server: ['HTTPS' => true]); $this->client->disableReboot(); $this->em = self::getContainer()->get(EntityManagerInterface::class); $this->em->getConnection()->beginTransaction(); diff --git a/tests/Controller/BookingControllerTest.php b/tests/Controller/BookingControllerTest.php index 141c576..ab9a6e1 100644 --- a/tests/Controller/BookingControllerTest.php +++ b/tests/Controller/BookingControllerTest.php @@ -29,7 +29,7 @@ class BookingControllerTest extends WebTestCase protected function setUp(): void { - $this->client = self::createClient(); + $this->client = self::createClient(server: ['HTTPS' => true]); $this->client->disableReboot(); $this->em = self::getContainer()->get(EntityManagerInterface::class); $this->em->getConnection()->beginTransaction(); diff --git a/tests/Controller/DashboardControllerTest.php b/tests/Controller/DashboardControllerTest.php index 9485393..02dfa23 100644 --- a/tests/Controller/DashboardControllerTest.php +++ b/tests/Controller/DashboardControllerTest.php @@ -20,7 +20,7 @@ class DashboardControllerTest extends WebTestCase protected function setUp(): void { - $this->client = self::createClient(); + $this->client = self::createClient(server: ['HTTPS' => true]); $this->client->disableReboot(); $this->em = self::getContainer()->get(EntityManagerInterface::class); $this->em->getConnection()->beginTransaction(); diff --git a/tests/Controller/FloorPlanTest.php b/tests/Controller/FloorPlanTest.php index bb19078..2663573 100644 --- a/tests/Controller/FloorPlanTest.php +++ b/tests/Controller/FloorPlanTest.php @@ -27,7 +27,7 @@ class FloorPlanTest extends WebTestCase protected function setUp(): void { - $this->client = self::createClient(); + $this->client = self::createClient(server: ['HTTPS' => true]); $this->client->disableReboot(); $this->em = self::getContainer()->get(EntityManagerInterface::class); $this->em->getConnection()->beginTransaction(); diff --git a/tests/EventListener/HtmxErrorFlashListenerTest.php b/tests/EventListener/HtmxErrorFlashListenerTest.php index 6c89e19..4fc628e 100644 --- a/tests/EventListener/HtmxErrorFlashListenerTest.php +++ b/tests/EventListener/HtmxErrorFlashListenerTest.php @@ -23,7 +23,7 @@ class HtmxErrorFlashListenerTest extends WebTestCase protected function setUp(): void { - $this->client = self::createClient(); + $this->client = self::createClient(server: ['HTTPS' => true]); $this->client->disableReboot(); $this->em = self::getContainer()->get(EntityManagerInterface::class); $this->em->getConnection()->beginTransaction(); diff --git a/tests/Security/LoginEntryPointTest.php b/tests/Security/LoginEntryPointTest.php index 18e63ac..131dea9 100644 --- a/tests/Security/LoginEntryPointTest.php +++ b/tests/Security/LoginEntryPointTest.php @@ -17,7 +17,7 @@ class LoginEntryPointTest extends WebTestCase */ public function testAnExpiredSessionOnAnHtmxRequestNavigatesToTheLoginPage(): void { - $client = self::createClient(); + $client = self::createClient(server: ['HTTPS' => true]); $client->request('GET', '/book/desk', server: ['HTTP_HX-Request' => 'true']); @@ -26,7 +26,7 @@ class LoginEntryPointTest extends WebTestCase public function testAnExpiredSessionOnAnOrdinaryRequestStillRedirects(): void { - $client = self::createClient(); + $client = self::createClient(server: ['HTTPS' => true]); $client->request('GET', '/book/desk');