コード例 #1
0
 public function testSetPath()
 {
     $url = new \webignition\NormalisedUrl\NormalisedUrl('http://example.com/');
     $url->setPath('/path/././././././././');
     $this->assertEquals('/path/', $url->getPath());
     $this->assertEquals('http://example.com/path/', (string) $url);
 }
コード例 #2
0
 public function testAddPathToRootUrl()
 {
     $url = new \webignition\NormalisedUrl\NormalisedUrl('http://example.com');
     $url->setPath('/index.html');
     $this->assertEquals('http://example.com/index.html', (string) $url);
     $url = new \webignition\NormalisedUrl\NormalisedUrl('http://example.com/');
     $url->setPath('/index.html');
     $this->assertEquals('http://example.com/index.html', (string) $url);
 }