You are here

public function StreamedResponseTest::testConstructor in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/StreamedResponseTest.php \Symfony\Component\HttpFoundation\Tests\StreamedResponseTest::testConstructor()

File

vendor/symfony/http-foundation/Tests/StreamedResponseTest.php, line 19

Class

StreamedResponseTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testConstructor() {
  $response = new StreamedResponse(function () {
    echo 'foo';
  }, 404, array(
    'Content-Type' => 'text/plain',
  ));
  $this
    ->assertEquals(404, $response
    ->getStatusCode());
  $this
    ->assertEquals('text/plain', $response->headers
    ->get('Content-Type'));
}