mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-09 02:06:32 +02:00
Merge remote-tracking branch 'github-nickvergessen/ticket/12282' into develop-ascraeus
* github-nickvergessen/ticket/12282: [ticket/12282] Update new references [ticket/12282] Update container db mock [ticket/12282] Add new line at EOF of the interface [ticket/12282] Use interface for type hinting [ticket/12282] Use {@inheritDoc} for inherited methods [ticket/12282] Add Interface for DBAL drivers
This commit is contained in:
@@ -59,19 +59,43 @@ namespace phpbb\db\driver
|
||||
{
|
||||
class container_mock extends \phpbb\db\driver\driver
|
||||
{
|
||||
public function sql_connect()
|
||||
public function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
|
||||
{
|
||||
}
|
||||
|
||||
public function sql_query()
|
||||
public function sql_query($query = '', $cache_ttl = 0)
|
||||
{
|
||||
}
|
||||
|
||||
public function sql_fetchrow()
|
||||
public function sql_fetchrow($query_id = false)
|
||||
{
|
||||
}
|
||||
|
||||
public function sql_freeresult()
|
||||
public function sql_freeresult($query_id = false)
|
||||
{
|
||||
}
|
||||
|
||||
function sql_server_info($raw = false, $use_cache = true)
|
||||
{
|
||||
}
|
||||
|
||||
function sql_affectedrows()
|
||||
{
|
||||
}
|
||||
|
||||
function sql_rowseek($rownum, &$query_id)
|
||||
{
|
||||
}
|
||||
|
||||
function sql_nextid()
|
||||
{
|
||||
}
|
||||
|
||||
function sql_escape($msg)
|
||||
{
|
||||
}
|
||||
|
||||
function sql_like_expression($expression)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@@ -140,7 +140,7 @@ class phpbb_mock_cache implements \phpbb\cache\driver\driver_interface
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function sql_save(\phpbb\db\driver\driver $db, $query, $query_result, $ttl)
|
||||
public function sql_save(\phpbb\db\driver\driver_interface $db, $query, $query_result, $ttl)
|
||||
{
|
||||
return $query_result;
|
||||
}
|
||||
|
@@ -63,10 +63,10 @@ class phpbb_session_testable_factory
|
||||
/**
|
||||
* Retrieve the configured session class instance
|
||||
*
|
||||
* @param \phpbb\db\driver\driver $dbal The database connection to use for session data
|
||||
* @param \phpbb\db\driver\driver_interface $dbal The database connection to use for session data
|
||||
* @return phpbb_mock_session_testable A session instance
|
||||
*/
|
||||
public function get_session(\phpbb\db\driver\driver $dbal)
|
||||
public function get_session(\phpbb\db\driver\driver_interface $dbal)
|
||||
{
|
||||
// set up all the global variables used by session
|
||||
global $SID, $_SID, $db, $config, $cache, $request, $phpbb_container;
|
||||
|
@@ -321,7 +321,7 @@ class phpbb_database_test_connection_manager
|
||||
* Compile the correct schema filename (as per create_schema_files) and
|
||||
* load it into the database.
|
||||
*/
|
||||
protected function load_schema_from_file($directory, \phpbb\db\driver\driver $db)
|
||||
protected function load_schema_from_file($directory, \phpbb\db\driver\driver_interface $db)
|
||||
{
|
||||
$schema = $this->dbms['SCHEMA'];
|
||||
|
||||
|
@@ -150,7 +150,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
// so we don't reopen an open connection
|
||||
if (!($this->db instanceof \phpbb\db\driver\driver))
|
||||
if (!($this->db instanceof \phpbb\db\driver\driver_interface))
|
||||
{
|
||||
$dbms = self::$config['dbms'];
|
||||
$this->db = new $dbms();
|
||||
|
Reference in New Issue
Block a user