DatabaseManager

Helper class for building a database connection in the test environment

since

2.0.0

package

Joomla Framework

Methods

__construct

DatabaseManager constructor.

__construct() : 
since

2.0.0

Response

mixed

clearTables

Clears the database tables of all data

clearTables() : 
since

2.0.0

throws

DatabaseConnectionNotInitialised

Response

void

createConnection

Create the DatabaseDriver object

createConnection() : 
since

2.0.0

Response

void

createDatabase

Creates the database for the test environment

createDatabase() : 

dropDatabase

Destroys the database for the test environment

dropDatabase() : 

getConnection

Fetches the database driver, creating it if not yet set up

getConnection() : \Joomla\Database\DatabaseInterface
since

2.0.0

Response

DatabaseInterface

getDbName

Fetch the name of the database to use

getDbName() : 
since

2.0.0

Response

string

initialiseParams

Initialize the parameter storage for the database connection

initialiseParams() : 
since

2.0.0

throws

MissingDatabaseCredentials

Response

void

Properties

connection

The database connection for the test environment

since

2.0.0

Type(s)

DatabaseInterface|null

dbFactory

The database factory

since

2.0.0

Type(s)

DatabaseFactory

params

The database connection parameters from the environment configuration

By default, this is seeded by a set of environment vars that you can set in your operating system environment or phpunit.xml configuration file. You may also customise the parameter configuration behavior for your environment if need be by extending the initialiseParams() method.

since

2.0.0

Type(s)

array<string|int, mixed>