Skip to content

Commit

Permalink
Start and end transactions on the fixtures datasource.
Browse files Browse the repository at this point in the history
Fixes #3490
  • Loading branch information
markstory committed Jan 5, 2013
1 parent 6d74397 commit ac1f64a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
Expand Up @@ -204,19 +204,16 @@ public function load(CakeTestCase $test) {
return;
}

$nested = $test->db->useNestedTransactions;
$test->db->useNestedTransactions = false;
$test->db->begin();
foreach ($fixtures as $f) {
if (!empty($this->_loaded[$f])) {
$fixture = $this->_loaded[$f];
$db = ConnectionManager::getDataSource($fixture->useDbConfig);
$db->begin();
$this->_setupTable($fixture, $db, $test->dropTables);
$fixture->insert($db);
$db->commit();
}
}
$test->db->commit();
$test->db->useNestedTransactions = $nested;
}

/**
Expand Down

0 comments on commit ac1f64a

Please sign in to comment.