From cd95ac3d0dfe818b3955aca819345c61ada3a2cb Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Thu, 2 Jul 2026 16:56:49 +0200 Subject: [PATCH] test: cover case-sensitive application URL paths --- .../ServicesControllerUrlDuplicateTest.php | 37 +++++++++++++++++++ tests/Unit/ValidationPatternsTest.php | 7 ++++ 2 files changed, 44 insertions(+) create mode 100644 tests/Unit/ServicesControllerUrlDuplicateTest.php diff --git a/tests/Unit/ServicesControllerUrlDuplicateTest.php b/tests/Unit/ServicesControllerUrlDuplicateTest.php new file mode 100644 index 000000000..8f3e4f9c4 --- /dev/null +++ b/tests/Unit/ServicesControllerUrlDuplicateTest.php @@ -0,0 +1,37 @@ +invoke($controller, $service, [ + ['name' => 'web', 'url' => 'https://example.com/Route'], + ['name' => 'api', 'url' => 'HTTPS://EXAMPLE.COM/route'], + ], '1'); + + expect($result['errors'] ?? [])->toBe([ + "Service container with 'web' not found.", + "Service container with 'api' not found.", + ]); +}); diff --git a/tests/Unit/ValidationPatternsTest.php b/tests/Unit/ValidationPatternsTest.php index 2b5763177..cb9d0144d 100644 --- a/tests/Unit/ValidationPatternsTest.php +++ b/tests/Unit/ValidationPatternsTest.php @@ -180,3 +180,10 @@ expect($environmentVariable->key)->toBe('APP_ENV'); }); + +it('normalizes application domain scheme and host without lowercasing path query or fragment', function () { + $domains = ' HTTPS://EXAMPLE.COM/MixedCase/Path?Token=ABC#Fragment, http://Sub.EXAMPLE.com/Api/V1 '; + + expect(ValidationPatterns::normalizeApplicationDomains($domains)) + ->toBe('https://example.com/MixedCase/Path?Token=ABC#Fragment,http://sub.example.com/Api/V1'); +});