You are here

public function vfsStreamFileTestCase::write in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamFileTestCase.php \org\bovigo\vfs\vfsStreamFileTestCase::write()

test writing data into the file

@test

File

vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamFileTestCase.php, line 183

Class

vfsStreamFileTestCase
Test for org\bovigo\vfs\vfsStreamFile.

Namespace

org\bovigo\vfs

Code

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());
}