org\bovigo\vfs\vfsStreamWrapperFlockTestCase::removesExclusiveLockOnStreamClose PHP Method

removesExclusiveLockOnStreamClose() public method

See also: https://github.com/mikey179/vfsStream/issues/31
See also: https://github.com/mikey179/vfsStream/issues/40
    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());
    }