|
| __construct ($name=NULL, array $data=array(), $dataName= '') |
|
|
| $testDatabase = '' |
|
| $backupGlobals = FALSE |
|
| $backupStaticAttributes = FALSE |
|
Tx_Phpunit_Database_TestCase::__construct |
( |
|
$name = NULL , |
|
|
array |
$data = array() , |
|
|
|
$dataName = '' |
|
) |
| |
Constructs a test case with the given name.
- Parameters
-
string | $name | the name of a testcase |
array | $data | ? |
string | $dataName | ? |
Tx_Phpunit_Database_TestCase::cleanDatabase |
( |
| ) |
|
|
protected |
Drops all tables in the test database.
- Returns
- void
Tx_Phpunit_Database_TestCase::createDatabase |
( |
| ) |
|
|
protected |
Accesses the TYPO3 database instance and uses it to fetch the list of available databases. Then this function creates a test database (if none has been set up yet).
- Returns
- bool TRUE if the database has been created successfully (or if there already is a test database), FALSE otherwise
Tx_Phpunit_Database_TestCase::dropDatabase |
( |
| ) |
|
|
protected |
Drops the test database.
- Returns
- bool TRUE if the database has been dropped successfully, FALSE otherwise
Tx_Phpunit_Database_TestCase::getDatabaseTables |
( |
|
$databaseName = NULL | ) |
|
|
protected |
Gets the names of all tables in the database with the given name.
- Parameters
-
string | $databaseName | the name of the database from which to retrieve the table names, if none is provided, the name of the current TYPO3 database plus a suffix "_test" is used |
- Returns
- string[] the names of all tables in the database $databaseName, might be empty
Tx_Phpunit_Database_TestCase::importExtensions |
( |
array |
$extensions, |
|
|
|
$importDependencies = FALSE , |
|
|
array & |
$skipDependencies = array() |
|
) |
| |
|
protected |
Imports the ext_tables.sql statements from the given extensions.
- Parameters
-
| string[] | $extensions keys of the extensions to import, may be empty |
bool | $importDependencies | whether to import dependency extensions on which the given extensions depend as well |
| string[] | &$skipDependencies keys of the extensions to skip, may be empty, will be modified |
- Returns
- void
Tx_Phpunit_Database_TestCase::selectDatabase |
( |
|
$databaseName, |
|
|
DatabaseConnection |
$database |
|
) |
| |
|
protected |
Selects the database depending on TYPO3 version.
- Parameters
-
string | $databaseName | the name of the database to select |
DatabaseConnection | $database | database object to process the change |
- Returns
- bool
Tx_Phpunit_Database_TestCase::switchToOriginalTypo3Database |
( |
|
$databaseObject | ) |
|
|
protected |
Switch to the original database
- Parameters
-
DatabaseConnection | $databaseObject | The database object |
- Returns
- void
Tx_Phpunit_Database_TestCase::switchToTypo3Database |
( |
| ) |
|
|
protected |
Selects the TYPO3 database (again).
If you have selected any non-TYPO3 in your unit tests, you need to call this function in tearDown() in order to avoid problems with the following unit tests and the TYPO3 back-end.
- Returns
- void
Tx_Phpunit_Database_TestCase::useTestDatabase |
( |
|
$databaseName = NULL | ) |
|
|
protected |
Sets the TYPO3 database instance to a test database.
Note: This function does not back up the currenty TYPO3 database instance.
- Parameters
-
string | $databaseName | the name of the test database to use; if none is provided, the name of the current TYPO3 database plus a suffix "_test" is used |
- Returns
- DatabaseConnection the test database
The documentation for this class was generated from the following file:
- Classes/Database/TestCase.php