[ticket/12012] Handle begin and commit transactions in tests

PHPBB3-12012
This commit is contained in:
Joas Schilling 2014-04-16 20:59:28 +02:00
parent 7dc163f2b7
commit a75ac5efd2

View file

@ -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);
}
} }
} }
} }