Fixed transaction manager tests using real DB
This commit is contained in:
parent
5cfb225400
commit
3b505a9c60
2 changed files with 3 additions and 3 deletions
|
@ -26,9 +26,9 @@ class TransactionManager
|
||||||
if ($pdo->inTransaction())
|
if ($pdo->inTransaction())
|
||||||
return $callback();
|
return $callback();
|
||||||
|
|
||||||
|
$pdo->beginTransaction();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$pdo->beginTransaction();
|
|
||||||
$ret = $callback();
|
$ret = $callback();
|
||||||
$pdo->$operation();
|
$pdo->$operation();
|
||||||
return $ret;
|
return $ret;
|
||||||
|
|
|
@ -67,11 +67,11 @@ class TransactionManagerTest extends \Szurubooru\Tests\AbstractDatabaseTestCase
|
||||||
|
|
||||||
private function getTestDao()
|
private function getTestDao()
|
||||||
{
|
{
|
||||||
return \Szurubooru\Injector::get(\Szurubooru\Dao\TokenDao::class);
|
return new \Szurubooru\Dao\TokenDao($this->databaseConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getTransactionManager()
|
private function getTransactionManager()
|
||||||
{
|
{
|
||||||
return \Szurubooru\Injector::get(\Szurubooru\Dao\TransactionManager::class);
|
return new \Szurubooru\Dao\TransactionManager($this->databaseConnection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue