org\bovigo\vfs\vfsStreamWrapperFlockTestCase::canAquireSharedLockIfAlreadySelfSharedLocked PHP Метод

canAquireSharedLockIfAlreadySelfSharedLocked() публичный Метод

См. также: https://github.com/mikey179/vfsStream/issues/40
    public function canAquireSharedLockIfAlreadySelfSharedLocked()
    {
        $file = vfsStream::newFile('foo.txt')->at($this->root);
        $fp = fopen(vfsStream::url('root/foo.txt'), 'rb');
        $file->lock($fp, LOCK_SH);
        $this->assertTrue(flock($fp, LOCK_SH));
        $this->assertTrue($file->isLocked());
        $this->assertTrue($file->hasSharedLock());
        $this->assertFalse($file->hasExclusiveLock());
        fclose($fp);
    }