You are here

public function vfsStreamWrapperFileTestCase::file_put_contentsExistingFile in Zircon Profile 8

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

assert that file_put_contents() delivers correct file contents

@test

File

vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperFileTestCase.php, line 48

Class

vfsStreamWrapperFileTestCase
Test for org\bovigo\vfs\vfsStreamWrapper.

Namespace

org\bovigo\vfs

Code

public function file_put_contentsExistingFile() {
  $this
    ->assertEquals(14, file_put_contents($this->baz2URL, 'baz is not bar'));
  $this
    ->assertEquals('baz is not bar', $this->baz2
    ->getContent());
  $this
    ->assertEquals(6, file_put_contents($this->baz1URL, 'foobar'));
  $this
    ->assertEquals('foobar', $this->baz1
    ->getContent());
  $this
    ->assertFalse(@file_put_contents($this->barURL, 'This does not work.'));
  $this
    ->assertFalse(@file_put_contents($this->fooURL, 'This does not work, too.'));
}