PHP Class malkusch\lock\util\DoubleCheckedLockingTest

See also: DoubleCheckedLocking
Author: Markus Malkusch ([email protected])
Inheritance: extends PHPUnit_Framework_TestCase
Show file Open project: malkusch/lock

Public Methods

Method Description
provideTestCodeNotExecuted ( ) : callable[][] Returns checks for testCodeNotExecuted().
testCheckFailsAcquiresNoLock ( ) Tests that the lock will not be acquired for a failing test.
testCodeExecuted ( ) Tests that the code executed if the checks are true.
testCodeNotExecuted ( callable $check ) Tests that the code is not executed if the first or second check fails.
testLockedCheckAndExecution ( ) Tests that the check and execution are in the same lock.

Protected Methods

Method Description
setUp ( )

Method Details

provideTestCodeNotExecuted() public method

Returns checks for testCodeNotExecuted().
public provideTestCodeNotExecuted ( ) : callable[][]
return callable[][] The test cases.

setUp() protected method

protected setUp ( )

testCheckFailsAcquiresNoLock() public method

Tests that the lock will not be acquired for a failing test.

testCodeExecuted() public method

Tests that the code executed if the checks are true.
public testCodeExecuted ( )

testCodeNotExecuted() public method

Tests that the code is not executed if the first or second check fails.
public testCodeNotExecuted ( callable $check )
$check callable The check.

testLockedCheckAndExecution() public method

Tests that the check and execution are in the same lock.