...
$imgPath = __DIR__ . '/../../storage/temp/source.jpg';
header('HTTP/1.1 200 OK');
header('Content-type:image/jpg');
echo file_get_contents($path);
exit();
}
Cannot modify header information - headers already sent by (output started at /var/www/.../.phpunit/phpunit-7.5-0/src/Util/Printer.php:113) (500 Internal Server Error)
/var/www/.../vendor/symfony/framework-bundle/Test/BrowserKitAssertionsTrait.php:132
/var/www/.../vendor/symfony/framework-bundle/Test/BrowserKitAssertionsTrait.php:33
/var/www/.../tests/Controller/ImagesControllerTest.php:30
qH��/����˅�t{�Sdž��V�����S<�-�,�W��BpѠ�
public function testGetRemoteImage(): void
{
$uri = '/image/path/' . $this->params['remote']['image_name'] . '/remote';
ob_start();
$client = static::$client;
$client->request('GET', $uri);
$client->getResponse()->sendContent();
$content = ob_get_contents();
ob_clean();
static::assertResponseIsSuccessful();
static::assertResponseHeaderSame('Content-Type', 'image/jpg');
static::assertIsString(gettype($content));
}
метод контроллера:
тест: