Exemple #1
0
 public function testCanReadFromMultipleStreams()
 {
     $a = new AppendStream([Stream::factory('foo'), Stream::factory('bar'), Stream::factory('baz')]);
     $this->assertFalse($a->eof());
     $this->assertSame(0, $a->tell());
     $this->assertEquals('foo', $a->read(3));
     $this->assertEquals('bar', $a->read(3));
     $this->assertEquals('baz', $a->read(3));
     $this->assertTrue($a->eof());
     $this->assertSame(9, $a->tell());
     $this->assertEquals('foobarbaz', (string) $a);
 }