Beispiel #1
0
 public function testUseAbsoluteUriSetsFullUriInResponse()
 {
     $_SERVER['HTTP_HOST'] = 'foobar.example.com';
     $_SERVER['SERVER_PORT'] = '4443';
     $_SERVER['HTTPS'] = 1;
     $this->redirector->setUseAbsoluteUri(true);
     $this->redirector->gotoUrl('/bar/baz');
     $headers = $this->response->getHeaders();
     $uri = false;
     foreach ($headers as $header) {
         if ('Location' == $header['name']) {
             $uri = $header['value'];
         }
     }
     if (!$uri) {
         $this->fail('No redirect header set in response');
     }
     $this->assertEquals('https://foobar.example.com:4443/bar/baz', $uri);
 }