Skip to content

Commit

Permalink
Reorder operations done in a FixtureManager::loadSingle() call
Browse files Browse the repository at this point in the history
  • Loading branch information
HavokInspiration committed Oct 15, 2015
1 parent 7b2da71 commit 61675b7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/TestSuite/Fixture/FixtureManager.php
Expand Up @@ -377,19 +377,17 @@ public function loadSingle($name, $db = null, $dropTables = true)
$db = ConnectionManager::get($fixture->connection());
}

$fixture->dropConstraints($db);

if (!$this->isFixtureSetup($db->configName(), $fixture)) {
$sources = $db->schemaCollection()->listTables();
$this->_setupTable($fixture, $db, $sources, $dropTables);
}

$fixture->createConstraints($db);

if (!$dropTables) {
$fixture->dropConstraints($db);
$fixture->truncate($db);
}

$fixture->createConstraints($db);
$fixture->insert($db);
} else {
throw new UnexpectedValueException(sprintf('Referenced fixture class %s not found', $name));
Expand Down

0 comments on commit 61675b7

Please sign in to comment.