NinjaMutex\Tests\MutexLocksTest::testUnableToReleaseLockHeldByOtherLock PHP Метод

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

public testUnableToReleaseLockHeldByOtherLock ( NinjaMutex\Lock\LockInterface $lockImplementor )
$lockImplementor NinjaMutex\Lock\LockInterface
    public function testUnableToReleaseLockHeldByOtherLock(LockInterface $lockImplementor)
    {
        $mutex1 = new Mutex('forfiter', $lockImplementor);
        $mutex1->acquireLock(0);
        $mutex = new Mutex('forfiter', $lockImplementor);
        // We don't acquire lock
        $this->assertFalse($mutex->isAcquired());
        // But it's held by other process
        $this->assertTrue($mutex->isLocked());
        // So we should be unable to release lock
        $this->assertFalse($mutex->releaseLock());
    }