/**
  * test writing data into the file
  *
  * @test
  */
 public function write()
 {
     $this->file->setContent('foobarbaz');
     $this->assertTrue($this->file->seek(3, SEEK_SET));
     $this->assertEquals(3, $this->file->write('foo'));
     $this->assertEquals('foofoobaz', $this->file->getContent());
     $this->assertEquals(9, $this->file->size());
     $this->assertEquals(3, $this->file->write('bar'));
     $this->assertEquals('foofoobar', $this->file->getContent());
     $this->assertEquals(9, $this->file->size());
 }
Exemple #2
0
 /**
  * seeks to the given offset
  *
  * @param   int   $offset
  * @param   int   $whence
  * @return  bool
  */
 public function stream_seek($offset, $whence)
 {
     return $this->content->seek($offset, $whence);
 }