summaryrefslogtreecommitdiff
path: root/tests/Unit/RouterTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Unit/RouterTest.php')
-rw-r--r--tests/Unit/RouterTest.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/Unit/RouterTest.php b/tests/Unit/RouterTest.php
index 0e270ca..b3013bb 100644
--- a/tests/Unit/RouterTest.php
+++ b/tests/Unit/RouterTest.php
@@ -69,6 +69,20 @@ it('finds segment one falls back to parameter', function () {
->parameters->{'test2'}->toBe('anything');
});
+it('finds segment case insentive', function() {
+ $router = new Router();
+
+ $r = $router->root();
+
+ $c1 = $r->child('LevEl1');
+ $c2 = $c1->child('LEVEL2');
+ $c3 = $c2->child('level3');
+
+ expect($router->findSegment('/level1')?->segment)->toBe($c1);
+ expect($router->findSegment('/level1/level2')?->segment)->toBe($c2);
+ expect($router->findSegment('/LevEL1/level2/LEVEL3')?->segment)->toBe($c3);
+});
+
it('finds segments in complex routes', function () {
$router = new Router();