From 043eb175723e2735a566b9657ac2bb720e7ab42f Mon Sep 17 00:00:00 2001 From: michalsn Date: Sat, 11 Jul 2020 11:43:33 +0200 Subject: [PATCH] Add more URI class tests to fully illustrate current behavior --- tests/system/HTTP/URITest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/system/HTTP/URITest.php b/tests/system/HTTP/URITest.php index 4039e8f23111..27a3e8cb1cae 100644 --- a/tests/system/HTTP/URITest.php +++ b/tests/system/HTTP/URITest.php @@ -49,6 +49,7 @@ public function testSegmentsIsPopulatedRightForMultipleSegments() $this->assertEquals('path', $uri->getSegment(1)); $this->assertEquals('to', $uri->getSegment(2)); $this->assertEquals('script', $uri->getSegment(3)); + $this->assertEquals('', $uri->getSegment(4)); $this->assertEquals(3, $uri->getTotalSegments()); } @@ -58,9 +59,8 @@ public function testSegmentsIsPopulatedRightForMultipleSegments() public function testSegmentOutOfRange() { $this->expectException(HTTPException::class); - $url = 'http://abc.com/a123/b/c'; - $uri = new URI($url); - $uri->getSegment(22); + $uri = new URI('http://hostname/path/to/script'); + $uri->getSegment(5); } //--------------------------------------------------------------------