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

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

См. также: https://github.com/mikey179/vfsStream/issues/40
    public function canAquireExclusiveLockIfAlreadySelfSharedLocked()
    {
        $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_EX));
        $this->assertTrue($file->isLocked());
        $this->assertFalse($file->hasSharedLock());
        $this->assertTrue($file->hasExclusiveLock());
        fclose($fp);
    }