You are here

public function DiactorosFactoryTest::testCreateResponseFromBinaryFile in Zircon Profile 8.0

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

File

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

Class

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

Namespace

Symfony\Bridge\PsrHttpMessage\Tests\Factory

Code

public function testCreateResponseFromBinaryFile() {
  $path = tempnam($this->tmpDir, uniqid());
  file_put_contents($path, 'Binary');
  $response = new BinaryFileResponse($path);
  $psrResponse = $this->factory
    ->createResponse($response);
  $this
    ->assertEquals('Binary', $psrResponse
    ->getBody()
    ->__toString());
}