示例#1
0
 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());
 }
示例#2
0
 /**
  * @expectedException Innmind\Filesystem\Exception\PositionNotSeekableException
  */
 public function testThrowWhenPositionNotSeekable()
 {
     $stream = new StringStream('Lorem ipsum dolor');
     $stream->seek(200);
 }