From e187da34e557583869ea07f6ce4e52251fe374ef Mon Sep 17 00:00:00 2001 From: TENMAJKL Date: Mon, 13 Nov 2023 13:26:06 +0100 Subject: [PATCH] and more tests --- tests/Routing/RouterTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Routing/RouterTest.php b/tests/Routing/RouterTest.php index 85c17c3..8f26d6f 100644 --- a/tests/Routing/RouterTest.php +++ b/tests/Routing/RouterTest.php @@ -145,9 +145,11 @@ public function testPriorityOfStaticRoutes() $r = $this->getRouter(); $r->get('/foo/{bar}', fn($bar) => $bar); $r->get('/foo/baz', fn() => 'foobaz'); + $r->get('foo', fn() => 'foo'); $this->assertThat($r->dispatch($this->emulate('/foo/baz', 'GET')), $this->equalTo(new HtmlResponse('foobaz'))); $this->assertThat($r->dispatch($this->emulate('/foo/bar', 'GET')), $this->equalTo(new HtmlResponse('bar'))); + $this->assertThat($r->dispatch($this->emulate('/foo', 'GET')), $this->equalTo(new HtmlResponse('foo'))); $r = $this->getRouter(); $r->collection(function() use ($r) { @@ -160,7 +162,7 @@ public function testPriorityOfStaticRoutes() $this->assertThat($r->dispatch($this->emulate('/foo/baz', 'GET')), $this->equalTo(new HtmlResponse('foobaz'))); $this->assertThat($r->dispatch($this->emulate('/foo/bar', 'GET')), $this->equalTo(new HtmlResponse('bar'))); $this->assertThat($r->dispatch($this->emulate('/foo/baz/baz/foo', 'GET')), $this->equalTo(new HtmlResponse('parek v rohliku'))); - $this->assertThat($r->dispatch($this->emulate('/foo/bar/baz/foo', 'GET')), $this->equalTo(new HtmlResponse('barfoo'))); + $this->assertThat($r->dispatch($this->emulate('/foo/rizek/baz/parek', 'GET')), $this->equalTo(new HtmlResponse('rizekparek'))); } }