Ejemplo n.º 1
0
Archivo: UrlTest.php Proyecto: weew/url
 public function test_sample()
 {
     $url = new Url('{subdomain}.service.com/users/{id}/profile');
     $url->replace('subdomain', 'api');
     $url->replace('id', 1);
     $this->assertEquals('api.service.com/users/1/profile', $url->toString());
     $url = new Url('{subdomain}.service.com/users/{id}/profile');
     $url->replaceAll(['subdomain' => 'api', 'id' => 1]);
     $this->assertEquals('api.service.com/users/1/profile', $url->toString());
 }
Ejemplo n.º 2
0
 public function test_header_location()
 {
     $url = new Url('http://foo.bar');
     $redirect = new RedirectResponse($url);
     $this->assertEquals($url->toString(), $redirect->getHeaders()->find('Location'));
 }