public function testWriting() { $str = new StringStream('foobar'); $this->assertTrue($str->isWritable()); $str->seek(3); $this->assertEquals(4, $str->write('bazz')); $this->assertEquals('', $str->getContents()); $this->assertEquals('foobazz', $str); $this->assertEquals(7, $str->getSize()); }
/** * @expectedException Innmind\Filesystem\Exception\PositionNotSeekableException */ public function testThrowWhenPositionNotSeekable() { $stream = new StringStream('Lorem ipsum dolor'); $stream->seek(200); }