You are here

public function vfsStreamWrapperFlockTestCase::removesExclusiveLockOnStreamClose in Zircon Profile 8

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

@test @group issue_31 @group issue_40

See also

https://github.com/mikey179/vfsStream/issues/31

https://github.com/mikey179/vfsStream/issues/40

File

vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperFlockTestCase.php, line 373

Class

vfsStreamWrapperFlockTestCase
Test for flock() implementation.

Namespace

org\bovigo\vfs

Code

public function removesExclusiveLockOnStreamClose() {
  $file = vfsStream::newFile('foo.txt')
    ->at($this->root);
  $fp = fopen(vfsStream::url('root/foo.txt'), 'rb');
  $file
    ->lock($fp, LOCK_EX);
  fclose($fp);
  $this
    ->assertFalse($file
    ->isLocked());
  $this
    ->assertFalse($file
    ->hasSharedLock());
  $this
    ->assertFalse($file
    ->hasExclusiveLock());
}