Example #1
0
 public function testPath()
 {
     $location = new UrlBasedLocation('http://localhost/symfony-2.2/web/app_dev.php/demo/hello/World?p1=1&p2=2');
     $this->assertEquals('http://localhost/symfony-2.2/web/app_dev.php/demo/hello/World', $location->getPath());
     $location = new UrlBasedLocation('http://localhost/symfony-2.2/web/app_dev.php/demo/hello/World?p1=1&p2=2', array('p1' => 5, "p3" => 3));
     $this->assertEquals('http://localhost/symfony-2.2/web/app_dev.php/demo/hello/World', $location->getPath());
     $location = new UrlBasedLocation('http://localhost/symfony-2.2/web/app_dev.php/demo/hello/World');
     $this->assertEquals('http://localhost/symfony-2.2/web/app_dev.php/demo/hello/World', $location->getPath());
 }
Example #2
0
 public function generateFromUrlBasedLocation(UrlBasedLocation $location)
 {
     return $location->getUrl();
 }