You are here

public function FunctionsTest::testCopiesToStream in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/psr7/tests/FunctionsTest.php \GuzzleHttp\Tests\Psr7\FunctionsTest::testCopiesToStream()

File

vendor/guzzlehttp/psr7/tests/FunctionsTest.php, line 30

Class

FunctionsTest

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testCopiesToStream() {
  $s1 = Psr7\stream_for('foobaz');
  $s2 = Psr7\stream_for('');
  Psr7\copy_to_stream($s1, $s2);
  $this
    ->assertEquals('foobaz', (string) $s2);
  $s2 = Psr7\stream_for('');
  $s1
    ->seek(0);
  Psr7\copy_to_stream($s1, $s2, 3);
  $this
    ->assertEquals('foo', (string) $s2);
  Psr7\copy_to_stream($s1, $s2, 3);
  $this
    ->assertEquals('foobaz', (string) $s2);
}