From 503bc06c703e12d3335b51c268699f4e80508ae2 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sun, 24 Jun 2012 12:57:54 -0400 Subject: [PATCH] Mark fixtures as created if they exist. Fixes #2905 --- lib/Cake/TestSuite/Fixture/CakeFixtureManager.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php b/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php index 0e262a9173b..b98c291d090 100644 --- a/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php +++ b/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php @@ -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; } }