public function vfsStreamWrapperFlockTestCase::canAquireSharedLockWithNonBlockingFlockCall in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperFlockTestCase.php \org\bovigo\vfs\vfsStreamWrapperFlockTestCase::canAquireSharedLockWithNonBlockingFlockCall()
@test
File
- vendor/
mikey179/ vfsStream/ src/ test/ php/ org/ bovigo/ vfs/ vfsStreamWrapperFlockTestCase.php, line 72
Class
- vfsStreamWrapperFlockTestCase
- Test for flock() implementation.
Namespace
org\bovigo\vfsCode
public function canAquireSharedLockWithNonBlockingFlockCall() {
$file = vfsStream::newFile('foo.txt')
->at($this->root);
$fp = fopen(vfsStream::url('root/foo.txt'), 'rb');
$this
->assertTrue(flock($fp, LOCK_SH | LOCK_NB));
$this
->assertTrue($file
->isLocked());
$this
->assertTrue($file
->hasSharedLock());
$this
->assertFalse($file
->hasExclusiveLock());
fclose($fp);
}