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()); }
public function test_header_location() { $url = new Url('http://foo.bar'); $redirect = new RedirectResponse($url); $this->assertEquals($url->toString(), $redirect->getHeaders()->find('Location')); }