GuzzleHttp\Tests\Psr7\FunctionsTest::testStopsCopyToSteamWhenReadFailsWithMaxLen PHP Метод

testStopsCopyToSteamWhenReadFailsWithMaxLen() публичный Метод

    public function testStopsCopyToSteamWhenReadFailsWithMaxLen()
    {
        $s1 = Psr7\stream_for('foobaz');
        $s1 = FnStream::decorate($s1, ['read' => function () {
            return '';
        }]);
        $s2 = Psr7\stream_for('');
        Psr7\copy_to_stream($s1, $s2, 10);
        $this->assertEquals('', (string) $s2);
    }
FunctionsTest