NinjaMutex\Tests\MutexLocksTest::testAllowToAcquireSelfOwnedLock PHP Method

testAllowToAcquireSelfOwnedLock() public method

public testAllowToAcquireSelfOwnedLock ( NinjaMutex\Lock\LockInterface $lockImplementor )
$lockImplementor NinjaMutex\Lock\LockInterface
    public function testAllowToAcquireSelfOwnedLock(LockInterface $lockImplementor)
    {
        $mutex = new Mutex('forfiter', $lockImplementor);
        $mutex->acquireLock(0);
        // Another try to acquire lock is successful
        // because lock is already acquired by this mutex
        $this->assertTrue($mutex->acquireLock(0));
        $this->assertTrue($mutex->isAcquired());
        $this->assertTrue($mutex->isLocked());
    }