You are here

public function vfsStreamExLockTestCase::flockSouldPass in Zircon Profile 8

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

@test

File

vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamExLockTestCase.php, line 46

Class

vfsStreamExLockTestCase
Test for LOCK_EX behaviour related to file_put_contents().

Namespace

org\bovigo\vfs

Code

public function flockSouldPass() {
  $fp = fopen(vfsStream::url('root/testfile'), 'w');
  flock($fp, LOCK_EX);
  fwrite($fp, "another string\n");
  flock($fp, LOCK_UN);
  fclose($fp);
  $this
    ->assertEquals("another string\n", file_get_contents(vfsStream::url('root/testfile')));
}