public function testToString() { if ($this->stream->isReadable()) { $this->assertEquals(0, $this->stream->tell()); $this->assertEquals('foobar', (string) $this->stream); $this->assertEquals(6, $this->stream->tell()); } else { $this->assertEquals('', (string) $this->stream); } }
public function __construct(StreamInterface $stream) { $this->data = ''; $this->length = $stream->getSize(); $this->source = $stream; }