Exemplo n.º 1
0
 public function testPath()
 {
     $url = new CUrl("http://www.example.com");
     // path normalization makes an empty path be "/"
     $this->assertTrue($url->path()->pathString()->equals("/"));
     $url = new CUrl("http://www.example.com/path/to/item");
     $urlPath = $url->path();
     $this->assertTrue($urlPath->pathString()->equals("/path/to/item") && $urlPath->component(0)->equals("path") && $urlPath->component(1)->equals("to") && $urlPath->component(2)->equals("item"));
     $url = new CUrl("http://www.example.com/path/to/so%6De%20item");
     $this->assertTrue($url->path()->pathString()->equals("/path/to/some%20item"));
 }