Skip to content

Commit

Permalink
Mark fixtures as created if they exist.
Browse files Browse the repository at this point in the history
Fixes #2905
  • Loading branch information
markstory committed Jun 24, 2012
1 parent b913fe5 commit 503bc06
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
Expand Up @@ -169,12 +169,15 @@ protected function _setupTable($fixture, $db = null, $drop = true) {

$sources = $db->listSources();
$table = $db->config['prefix'] . $fixture->table;
$exists = in_array($table, $sources);

if ($drop && in_array($table, $sources)) {
if ($drop && $exists) {
$fixture->drop($db);
$fixture->create($db);
} elseif (!in_array($table, $sources)) {
} elseif (!$exists) {
$fixture->create($db);
} else {
$fixture->created[] = $db->configKeyName;
}
}

Expand Down

0 comments on commit 503bc06

Please sign in to comment.