PHP Класс phpbb_database_test_connection_manager

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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

Защищенные методы

Метод Описание
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.

Описание методов

__construct() публичный Метод

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

connect() публичный Метод

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() публичный Метод

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))
Результат null

ensure_connected() защищенный Метод

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

get_dbms_data() защищенный Метод

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

get_pdo() публичный Метод

Return the current PDO instance
public get_pdo ( )

get_tables() публичный Метод

Retrieves a list of all tables from the database.
public get_tables ( ) : array(string)
Результат array(string)

load_schema() публичный Метод

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

load_schema_from_file() защищенный Метод

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() публичный Метод

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
Результат null

purge_extras() публичный Метод

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

recreate_db() публичный Метод

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