@@ -60,6 +60,7 @@ public function testSegmentsIsPopulatedRightForMultipleSegments()
6060 public function testSegmentOutOfRange ()
6161 {
6262 $ this ->expectException (HTTPException::class);
63+
6364 $ uri = new URI ('http://hostname/path/to/script ' );
6465 $ uri ->getSegment (5 );
6566 }
@@ -68,12 +69,14 @@ public function testSegmentOutOfRangeWithSilent()
6869 {
6970 $ url = 'http://abc.com/a123/b/c ' ;
7071 $ uri = new URI ($ url );
72+
7173 $ this ->assertSame ('' , $ uri ->setSilent ()->getSegment (22 ));
7274 }
7375
7476 public function testSegmentOutOfRangeWithDefaultValue ()
7577 {
7678 $ this ->expectException (HTTPException::class);
79+
7780 $ url = 'http://abc.com/a123/b/c ' ;
7881 $ uri = new URI ($ url );
7982 $ uri ->getSegment (22 , 'something ' );
@@ -83,6 +86,7 @@ public function testSegmentOutOfRangeWithSilentAndDefaultValue()
8386 {
8487 $ url = 'http://abc.com/a123/b/c ' ;
8588 $ uri = new URI ($ url );
89+
8690 $ this ->assertSame ('something ' , $ uri ->setSilent ()->getSegment (22 , 'something ' ));
8791 }
8892
@@ -126,10 +130,12 @@ public function testSimpleUri()
126130 {
127131 $ url = 'http://example.com ' ;
128132 $ uri = new URI ($ url );
133+
129134 $ this ->assertSame ($ url , (string ) $ uri );
130135
131136 $ url = 'http://example.com/ ' ;
132137 $ uri = new URI ($ url );
138+
133139 $ this ->assertSame ($ url , (string ) $ uri );
134140 }
135141
@@ -140,12 +146,14 @@ public function testEmptyUri()
140146 $ this ->assertSame ('http:// ' . $ url , (string ) $ uri );
141147 $ url = '/ ' ;
142148 $ uri = new URI ($ url );
149+
143150 $ this ->assertSame ('http:// ' , (string ) $ uri );
144151 }
145152
146153 public function testMalformedUri ()
147154 {
148155 $ this ->expectException (HTTPException::class);
156+
149157 $ url = 'http://abc:a123 ' ;
150158 new URI ($ url );
151159 }
@@ -154,6 +162,7 @@ public function testMissingScheme()
154162 {
155163 $ url = 'http://foo.bar/baz ' ;
156164 $ uri = new URI ($ url );
165+
157166 $ this ->assertSame ('http ' , $ uri ->getScheme ());
158167 $ this ->assertSame ('foo.bar ' , $ uri ->getAuthority ());
159168 $ this ->assertSame ('/baz ' , $ uri ->getPath ());
@@ -165,6 +174,7 @@ public function testSchemeSub()
165174 $ url = 'example.com ' ;
166175 $ uri = new URI ('http:// ' . $ url );
167176 $ uri ->setScheme ('x ' );
177+
168178 $ this ->assertSame ('x:// ' . $ url , (string ) $ uri );
169179 }
170180
@@ -245,6 +255,7 @@ public function testSetPortInvalidValues()
245255
246256 $ this ->expectException (HTTPException::class);
247257 $ this ->expectExceptionMessage (lang ('HTTP.invalidPort ' , ['70000 ' ]));
258+
248259 $ uri ->setPort (70000 );
249260 }
250261
@@ -265,6 +276,7 @@ public function testSetPortTooSmall()
265276
266277 $ this ->expectException (HTTPException::class);
267278 $ this ->expectExceptionMessage (lang ('HTTP.invalidPort ' , [-1 ]));
279+
268280 $ uri ->setPort (-1 );
269281 }
270282
@@ -275,12 +287,14 @@ public function testSetPortZero()
275287
276288 $ this ->expectException (HTTPException::class);
277289 $ this ->expectExceptionMessage (lang ('HTTP.invalidPort ' , [0 ]));
290+
278291 $ uri ->setPort (0 );
279292 }
280293
281294 public function testCatchesBadPort ()
282295 {
283296 $ this ->expectException (HTTPException::class);
297+
284298 $ url = 'http://username:password@hostname:90909/path?arg=value#anchor ' ;
285299 $ uri = new URI ();
286300 $ uri ->setURI ($ url );
@@ -407,6 +421,7 @@ public function testSetQueryThrowsErrorWhenFragmentPresent()
407421 $ uri = new URI ($ url );
408422
409423 $ this ->expectException (HTTPException::class);
424+
410425 $ uri ->setQuery ('?key=value#fragment ' );
411426 }
412427
@@ -936,6 +951,7 @@ public function testZeroAsURIPath()
936951 {
937952 $ url = 'http://example.com/0 ' ;
938953 $ uri = new URI ($ url );
954+
939955 $ this ->assertSame ($ url , (string ) $ uri );
940956 $ this ->assertSame ('/0 ' , $ uri ->getPath ());
941957 }
@@ -944,6 +960,7 @@ public function testEmptyURIPath()
944960 {
945961 $ url = 'http://example.com/ ' ;
946962 $ uri = new URI ($ url );
963+
947964 $ this ->assertSame ([], $ uri ->getSegments ());
948965 $ this ->assertSame (0 , $ uri ->getTotalSegments ());
949966 }
@@ -963,6 +980,7 @@ public function testSetURISilent()
963980 {
964981 $ url = ': ' ;
965982 $ uri = new URI ();
983+
966984 $ uri ->setSilent ()->setURI ($ url );
967985
968986 $ this ->assertTrue (true );
0 commit comments