PHP Class malkusch\lock\mutex\TransactionalMutexTest

Set the environment variables MYSQL_DSN, MYSQL_USER for this test.
See also: TransactionalMutex
Author: Markus Malkusch ([email protected])
Inheritance: extends PHPUnit_Framework_TestCase
Show file Open project: malkusch/lock

Public Methods

Method Description
provideTestInvalidErrorMode ( ) : array Returns test cases for testInvalidErrorMode().
provideTestReplayTransaction ( ) : Exception[][] Returns test cases for testReplayTransaction().
testBeginFails ( ) Tests BEGIN fails.
testExceptionRollsback ( ) Tests that an exception in the critical code causes a ROLLBACK.
testFailExceptionRollsback ( ) Tests that a ROLLBACK caused by an exception fails.
testInvalidErrorMode ( integer $mode ) Tests building the mutex with an invalid error mode.
testReplayTransaction ( Exception $exception ) Tests replaying the transaction.
testRollbackAfterFailedCommitFails ( ) Tests failing a ROLLBACK after the failed COMMIT.

Private Methods

Method Description
buildMySqlPdo ( ) : PDO Builds a MySQL PDO.

Method Details

provideTestInvalidErrorMode() public method

Returns test cases for testInvalidErrorMode().
public provideTestInvalidErrorMode ( ) : array
return array Test cases.

provideTestReplayTransaction() public method

Returns test cases for testReplayTransaction().
public provideTestReplayTransaction ( ) : Exception[][]
return Exception[][] Test cases.

testBeginFails() public method

Tests BEGIN fails.
public testBeginFails ( )

testExceptionRollsback() public method

Tests that an exception in the critical code causes a ROLLBACK.

testFailExceptionRollsback() public method

Tests that a ROLLBACK caused by an exception fails.

testInvalidErrorMode() public method

Tests building the mutex with an invalid error mode.
public testInvalidErrorMode ( integer $mode )
$mode integer The invalid error mode.

testReplayTransaction() public method

Tests replaying the transaction.
public testReplayTransaction ( Exception $exception )
$exception Exception The thrown exception.

testRollbackAfterFailedCommitFails() public method

Tests failing a ROLLBACK after the failed COMMIT.