org\bovigo\vfs\vfsStreamWrapperFlockTestCase::canRemoveSharedLockWithoutRemovingSharedLockOnOtherFileHandler PHP 메소드

canRemoveSharedLockWithoutRemovingSharedLockOnOtherFileHandler() 공개 메소드

또한 보기: https://github.com/mikey179/vfsStream/issues/40
    public function canRemoveSharedLockWithoutRemovingSharedLockOnOtherFileHandler()
    {
        $file = vfsStream::newFile('foo.txt')->at($this->root);
        $fp1 = fopen(vfsStream::url('root/foo.txt'), 'rb');
        $fp2 = fopen(vfsStream::url('root/foo.txt'), 'rb');
        $file->lock($fp1, LOCK_SH);
        $file->lock($fp2, LOCK_SH);
        $this->assertTrue(flock($fp1, LOCK_UN));
        $this->assertTrue($file->hasSharedLock());
        $this->assertFalse($file->hasSharedLock($fp1));
        $this->assertTrue($file->hasSharedLock($fp2));
        fclose($fp1);
        fclose($fp2);
    }