PHP Class malkusch\lock\mutex\MutexTest

If you want to run integrations tests you should provide these environment variables: - MEMCACHE_HOST - REDIS_URIS - a comma separated list of redis:// URIs.
See also: Mutex
Author: Markus Malkusch ([email protected])
Inheritance: extends PHPUnit_Framework_TestCase
Datei anzeigen Open project: malkusch/lock

Public Methods

Method Description
provideMutexFactories ( ) : callable[][] Provides Mutex factories.
testLiveness ( callable $mutexFactory ) Tests that locks will be released automatically.
testRelease ( callable $mutexFactory ) Tests that synchronized() released the lock.
testSynchronizedDelegates ( callable $mutexFactory ) Tests synchronized() executes the code and returns its result.
testSynchronizedPassesExceptionThrough ( callable $mutexFactory ) Tests synchronized() rethrows the exception of the code.

Method Details

provideMutexFactories() public method

Provides Mutex factories.
public provideMutexFactories ( ) : callable[][]
return callable[][] The mutex factories.

testLiveness() public method

Tests that locks will be released automatically.
public testLiveness ( callable $mutexFactory )
$mutexFactory callable The Mutex factory.

testRelease() public method

Tests that synchronized() released the lock.
public testRelease ( callable $mutexFactory )
$mutexFactory callable The Mutex factory.

testSynchronizedDelegates() public method

Tests synchronized() executes the code and returns its result.
public testSynchronizedDelegates ( callable $mutexFactory )
$mutexFactory callable The Mutex factory.

testSynchronizedPassesExceptionThrough() public method

Tests synchronized() rethrows the exception of the code.
public testSynchronizedPassesExceptionThrough ( callable $mutexFactory )
$mutexFactory callable The Mutex factory.