HEX
Server: Apache
System: Linux srv13.cpanelhost.cl 3.10.0-962.3.2.lve1.5.38.el7.x86_64 #1 SMP Thu Jun 18 05:28:41 EDT 2020 x86_64
User: cca63905 (4205)
PHP: 7.3.20
Disabled: NONE
Upload Files
File: //proc/self/cwd/nueva/vendor/csa/guzzle-bundle/src/Tests/HttpFoundation/StreamResponseTest.php
<?php

/*
 * This file is part of the CsaGuzzleBundle package
 *
 * (c) Charles Sarrazin <charles@sarraz.in>
 * (c) PrestaShop and Contributors
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code
 */

namespace Csa\Bundle\GuzzleBundle\Tests\HttpFoundation;

use Csa\Bundle\GuzzleBundle\HttpFoundation\StreamResponse;
use GuzzleHttp\Message\Response;
use GuzzleHttp\Stream\Stream;

class StreamResponseTest extends \PHPUnit\Framework\TestCase
{
    public function testNormalOutput()
    {
        $this->expectOutputString('this should not be streamed');

        $mock = new Response(200, [], Stream::factory('this should not be streamed'));
        $response = new StreamResponse($mock);
        $response->send();
    }

    public function testChunkedOutput()
    {
        $this->expectOutputString("a\r\nthis shoul\r\na\r\nd not be s\r\n7\r\ntreamed\r\n0\r\n\r\n");

        $mock = new Response(200, ['Transfer-Encoding' => 'chunked'], Stream::factory('this should not be streamed'));
        $response = new StreamResponse($mock, 10);
        $response->send();
    }
}