PHP Class bandwidthThrottle\tokenBucket\storage\PDOStorageTest

If you want to run vendor specific PDO tests you should provide these environment variables: - MYSQL_DSN, MYSQL_USER - PGSQL_DSN, PGSQL_USER
See also: PDOStorage
Author: Markus Malkusch ([email protected])
Inheritance: extends PHPUnit_Framework_TestCase
Show file Open project: bandwidth-throttle/token-bucket

Public Methods

Method Description
providePDO ( ) : PDO[][] Provides the PDO.
provideTestInvalidErrorMode ( ) : int[][] Provides test cases for testInvalidErrorMode()
testBootstrapAddsRow ( PDO $pdo ) Tests bootstrap() adds a row to an existing table.
testBootstrapFailsForExistingRow ( PDO $pdo ) Tests bootstrap() would add a row to an existing table, but fails.
testInvalidErrorMode ( integer $errorMode ) Tests instantiation with PDO in wrong error mode should fail.
testLongName ( ) Tests instantiation with a long name should not fail.
testRemoveOneRow ( PDO $pdo ) Tests remove() removes only one row.
testRemoveTable ( PDO $pdo ) Tests remove() removes the table after the last row.
testTooLongNameFails ( ) Tests instantiation with a too long name should fail.
testValidErrorMode ( ) Tests instantiation with PDO in valid error mode.

Protected Methods

Method Description
tearDown ( )

Method Details

providePDO() public method

Provides the PDO.
public providePDO ( ) : PDO[][]
return PDO[][] The PDOs.

provideTestInvalidErrorMode() public method

Provides test cases for testInvalidErrorMode()
public provideTestInvalidErrorMode ( ) : int[][]
return int[][] Invalid error modes.

tearDown() protected method

protected tearDown ( )

testBootstrapAddsRow() public method

Tests bootstrap() adds a row to an existing table.
public testBootstrapAddsRow ( PDO $pdo )
$pdo PDO The PDO.

testBootstrapFailsForExistingRow() public method

Tests bootstrap() would add a row to an existing table, but fails.
public testBootstrapFailsForExistingRow ( PDO $pdo )
$pdo PDO The PDO.

testInvalidErrorMode() public method

Tests instantiation with PDO in wrong error mode should fail.
public testInvalidErrorMode ( integer $errorMode )
$errorMode integer The invalid error mode.

testLongName() public method

Tests instantiation with a long name should not fail.
public testLongName ( )

testRemoveOneRow() public method

Tests remove() removes only one row.
public testRemoveOneRow ( PDO $pdo )
$pdo PDO The PDO.

testRemoveTable() public method

Tests remove() removes the table after the last row.
public testRemoveTable ( PDO $pdo )
$pdo PDO The PDO.

testTooLongNameFails() public method

Tests instantiation with a too long name should fail.

testValidErrorMode() public method

Tests instantiation with PDO in valid error mode.
public testValidErrorMode ( )