Fixed transaction manager tests using real DB

This commit is contained in:
Marcin Kurczewski 2014-09-18 10:42:34 +02:00
parent 5cfb225400
commit 3b505a9c60
2 changed files with 3 additions and 3 deletions

View file

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

View file

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