public function testGetContentsShouldReturnStreamContentsFromCurrentPointer() { $this->tmpnam = tempnam(sys_get_temp_dir(), 'diac'); $resource = fopen($this->tmpnam, 'r+'); $this->stream->attach($resource); fwrite($resource, 'FooBar'); // seek to position 3 $this->stream->seek(3); $test = $this->stream->getContents(); $this->assertEquals('Bar', $test); }