mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
[ticket/12012] Handle begin and commit transactions in tests
PHPBB3-12012
This commit is contained in:
@@ -14,6 +14,7 @@ class phpbb_database_test_connection_manager
|
|||||||
{
|
{
|
||||||
private $config;
|
private $config;
|
||||||
private $dbms;
|
private $dbms;
|
||||||
|
/** @var PDO */
|
||||||
private $pdo;
|
private $pdo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -363,9 +364,21 @@ class phpbb_database_test_connection_manager
|
|||||||
$table_name,
|
$table_name,
|
||||||
$table_data
|
$table_data
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($queries as $query)
|
foreach ($queries as $query)
|
||||||
{
|
{
|
||||||
$this->pdo->exec($query);
|
if ($query === 'begin')
|
||||||
|
{
|
||||||
|
$this->pdo->beginTransaction();
|
||||||
|
}
|
||||||
|
else if ($query === 'commit')
|
||||||
|
{
|
||||||
|
$this->pdo->commit();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->pdo->exec($query);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user