10            'REQUEST_URI'     => 
'/foo',
 
   11            'REQUEST_METHOD'  => 
'GET',
 
   12            'HTTP_USER_AGENT' => 
'Evert',
 
   13            'CONTENT_TYPE'    => 
'text/xml',
 
   14            'CONTENT_LENGTH'  => 
'400',
 
   15            'SERVER_PROTOCOL' => 
'HTTP/1.0',
 
   18        $this->assertEquals(
'GET', 
$request->getMethod());
 
   19        $this->assertEquals(
'/foo', 
$request->getUrl());
 
   21            'User-Agent'     => [
'Evert'],
 
   22            'Content-Type'   => [
'text/xml'],
 
   23            'Content-Length' => [
'400'],
 
   26        $this->assertEquals(
'1.0', 
$request->getHttpVersion());
 
   28        $this->assertEquals(
'400', 
$request->getRawServerValue(
'CONTENT_LENGTH'));
 
   29        $this->assertNull(
$request->getRawServerValue(
'FOO'));
 
   36            'REQUEST_URI'    => 
'/foo',
 
   37            'REQUEST_METHOD' => 
'GET',
 
   38            'PHP_AUTH_USER'  => 
'user',
 
   39            'PHP_AUTH_PW'    => 
'pass',
 
   42        $this->assertEquals(
'GET', 
$request->getMethod());
 
   43        $this->assertEquals(
'/foo', 
$request->getUrl());
 
   45            'Authorization' => [
'Basic ' . base64_encode(
'user:pass')],
 
   53            'REQUEST_URI'     => 
'/foo',
 
   54            'REQUEST_METHOD'  => 
'GET',
 
   55            'PHP_AUTH_DIGEST' => 
'blabla',
 
   58        $this->assertEquals(
'GET', 
$request->getMethod());
 
   59        $this->assertEquals(
'/foo', 
$request->getUrl());
 
   61            'Authorization' => [
'Digest blabla'],
 
   69            'REQUEST_URI'                 => 
'/foo',
 
   70            'REQUEST_METHOD'              => 
'GET',
 
   71            'REDIRECT_HTTP_AUTHORIZATION' => 
'Basic bla',
 
   74        $this->assertEquals(
'GET', 
$request->getMethod());
 
   75        $this->assertEquals(
'/foo', 
$request->getUrl());
 
   77            'Authorization' => [
'Basic bla'],
 
   90        if (!function_exists(
'xdebug_get_headers')) {
 
   91            $this->markTestSkipped(
'XDebug needs to be installed for this test to run');
 
   97        $response->addHeader(
'Content-Type', 
'application/xml');
 
  103        $headers = xdebug_get_headers();
 
  110                "Content-Type: text/xml;charset=UTF-8",
 
  111                "Content-Type: application/xml",
 
  116        $this->assertEquals(
'foo', 
$result);
 
  128        $response->addHeader(
'Content-Length', 19);
 
  129        $response->setBody(
'Send this sentence. Ignore this one.');
 
  138        $this->assertEquals(
'Send this sentence.', 
$result);
 
  150        $body = fopen(
'php://memory', 
'w');
 
  151        fwrite($body, 
'Ignore this. Send this sentence. Ignore this too.');
 
  163        $this->assertEquals(
'Send this sentence.', 
$result);
 
foreach($paths as $path) $request
An exception for terminatinating execution or to throw for unit testing.
This class represents a single HTTP response.
testSend()
@runInSeparateProcess
testSendLimitedByContentLengthString()
@runInSeparateProcess @depends testSend
testConstructFromServerArray()
testConstructPHPAuthDigest()
testSendLimitedByContentLengthStream()
@runInSeparateProcess @depends testSend
testConstructRedirectAuth()
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
static sendResponse(ResponseInterface $response)
Sends the HTTP response back to a HTTP client.