DbTestHelperTrait
Table of Contents
- $driver : mixed
- Should be "mysql", "pgsql", "sqlite".
- createSchema() : mixed
- Uses .sql files from the examples directory to initialize the database.
- dropTables() : mixed
- Drops tables, if they exist.
- getDb() : PDO
- Returns a fully configured PDO object.
- getPDO() : PDO
- Alias for getDb.
- tearDown() : void
Properties
$driver
Should be "mysql", "pgsql", "sqlite".
public
mixed
$driver
= null
Methods
createSchema()
Uses .sql files from the examples directory to initialize the database.
public
createSchema(string $schemaName) : mixed
Parameters
- $schemaName : string
Return values
mixed —dropTables()
Drops tables, if they exist.
public
dropTables(string|array<string|int, string> $tableNames) : mixed
Parameters
- $tableNames : string|array<string|int, string>
Return values
mixed —getDb()
Returns a fully configured PDO object.
public
getDb() : PDO
Return values
PDO —getPDO()
Alias for getDb.
public
getPDO() : PDO
Return values
PDO —tearDown()
public
tearDown() : void