You are here

public function DiactorosFactoryTest::testCreateResponseFromStreamed in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/psr-http-message-bridge/Tests/Factory/DiactorosFactoryTest.php \Symfony\Bridge\PsrHttpMessage\Tests\Factory\DiactorosFactoryTest::testCreateResponseFromStreamed()

File

vendor/symfony/psr-http-message-bridge/Tests/Factory/DiactorosFactoryTest.php, line 138

Class

DiactorosFactoryTest
@author Kévin Dunglas <dunglas@gmail.com>

Namespace

Symfony\Bridge\PsrHttpMessage\Tests\Factory

Code

public function testCreateResponseFromStreamed() {
  $response = new StreamedResponse(function () {
    echo "Line 1\n";
    flush();
    echo "Line 2\n";
    flush();
  });
  $psrResponse = $this->factory
    ->createResponse($response);
  $this
    ->assertEquals("Line 1\nLine 2\n", $psrResponse
    ->getBody()
    ->__toString());
}