PHP Class phpbb_database_test_connection_manager

Afficher le fichier Open project: phpbb/phpbb Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( array $config ) Constructor
connect ( boolean $use_db = true ) Creates a PDO connection for the configured database.
database_synchronisation ( array $table_column_map ) : null Performs synchronisations on the database after a fixture has been loaded
get_pdo ( ) Return the current PDO instance
get_tables ( ) : array(string) Retrieves a list of all tables from the database.
load_schema ( $db ) Load the phpBB database schema into the database
post_setup_synchronisation ( PHPUnit_Extensions_Database_DataSet_XmlDataSet $xml_data_set ) : null Performs synchronisations on the database after a fixture has been loaded
purge_extras ( ) Removes extra objects from a database. This is for cases where dropping the database fails.
recreate_db ( ) Drop the database if it exists and re-create it

Méthodes protégées

Méthode Description
ensure_connected ( $method_name ) Throw an exception if not connected
get_dbms_data ( $dbms ) Map a phpBB dbms driver name to dbms data array
load_schema_from_file ( $directory, phpbb\db\driver\driver_interface $db ) Compile the correct schema filename (as per create_schema_files) and load it into the database.

Method Details

__construct() public méthode

Constructor
public __construct ( array $config )
$config array Tests database configuration as returned by phpbb_database_test_case::get_database_config()

connect() public méthode

Creates a PDO connection for the configured database.
public connect ( boolean $use_db = true )
$use_db boolean Whether the DSN should be tied to a particular database making it impossible to delete that database.

database_synchronisation() public méthode

Performs synchronisations on the database after a fixture has been loaded
public database_synchronisation ( array $table_column_map ) : null
$table_column_map array Array of tables/columns to synchronise array(table1 => array(column1, column2))
Résultat null

ensure_connected() protected méthode

Throw an exception if not connected
protected ensure_connected ( $method_name )

get_dbms_data() protected méthode

Map a phpBB dbms driver name to dbms data array
protected get_dbms_data ( $dbms )

get_pdo() public méthode

Return the current PDO instance
public get_pdo ( )

get_tables() public méthode

Retrieves a list of all tables from the database.
public get_tables ( ) : array(string)
Résultat array(string)

load_schema() public méthode

Load the phpBB database schema into the database
public load_schema ( $db )

load_schema_from_file() protected méthode

Compile the correct schema filename (as per create_schema_files) and load it into the database.
protected load_schema_from_file ( $directory, phpbb\db\driver\driver_interface $db )
$db phpbb\db\driver\driver_interface

post_setup_synchronisation() public méthode

Performs synchronisations on the database after a fixture has been loaded
public post_setup_synchronisation ( PHPUnit_Extensions_Database_DataSet_XmlDataSet $xml_data_set ) : null
$xml_data_set PHPUnit_Extensions_Database_DataSet_XmlDataSet Information about the tables contained within the loaded fixture
Résultat null

purge_extras() public méthode

Removes extra objects from a database. This is for cases where dropping the database fails.
public purge_extras ( )

recreate_db() public méthode

Note: This does not load the schema, and it is suggested to re-connect after calling to get use_db isolation.
public recreate_db ( )