Documentation

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

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

Search results