You are here

public function vfsStreamFileTestCase::writeEmptyFile in Zircon Profile 8.0

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

test writing data into the file

@test

File

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

Class

vfsStreamFileTestCase
Test for org\bovigo\vfs\vfsStreamFile.

Namespace

org\bovigo\vfs

Code

public function writeEmptyFile() {
  $this
    ->assertEquals(3, $this->file
    ->write('foo'));
  $this
    ->assertEquals('foo', $this->file
    ->getContent());
  $this
    ->assertEquals(3, $this->file
    ->size());
  $this
    ->assertEquals(3, $this->file
    ->write('bar'));
  $this
    ->assertEquals('foobar', $this->file
    ->getContent());
  $this
    ->assertEquals(6, $this->file
    ->size());
}