Skip to content

Commit 36e13ca

Browse files
committed
test: add tests
1 parent 7c8c703 commit 36e13ca

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

tests/system/HTTP/URITest.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,32 @@ public function testSimpleUri()
138138
$this->assertSame($url, (string) $uri);
139139
}
140140

141+
public function testSimpleUriWithPath()
142+
{
143+
$url = 'http://example.com/one/two';
144+
$uri = new URI($url);
145+
146+
$this->assertSame($url, (string) $uri);
147+
148+
$url = 'http://example.com/one/two/';
149+
$uri = new URI($url);
150+
151+
$this->assertSame($url, (string) $uri);
152+
}
153+
154+
public function testSimpleUriWithPathDoubleSlashes()
155+
{
156+
$url = 'http://example.com/one/two//';
157+
$uri = new URI($url);
158+
159+
$this->assertSame('http://example.com/one/two/', (string) $uri);
160+
161+
$url = 'http://example.com//one/two/';
162+
$uri = new URI($url);
163+
164+
$this->assertSame('http://example.com/one/two/', (string) $uri);
165+
}
166+
141167
public function testEmptyUri()
142168
{
143169
$url = '';
@@ -979,6 +1005,7 @@ public function testEmptyURIPath()
9791005
$url = 'http://example.com/';
9801006
$uri = new URI($url);
9811007

1008+
$this->assertSame('/', $uri->getPath());
9821009
$this->assertSame([], $uri->getSegments());
9831010
$this->assertSame(0, $uri->getTotalSegments());
9841011
}

0 commit comments

Comments
 (0)