Skip to content
This repository
Browse code

Mark fixtures as created if they exist.

Fixes #2905
  • Loading branch information...
commit 503bc06c703e12d3335b51c268699f4e80508ae2 1 parent b913fe5
Mark Story authored June 24, 2012
7  lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
@@ -169,12 +169,15 @@ protected function _setupTable($fixture, $db = null, $drop = true) {
169 169
 
170 170
 		$sources = $db->listSources();
171 171
 		$table = $db->config['prefix'] . $fixture->table;
  172
+		$exists = in_array($table, $sources);
172 173
 
173  
-		if ($drop && in_array($table, $sources)) {
  174
+		if ($drop && $exists) {
174 175
 			$fixture->drop($db);
175 176
 			$fixture->create($db);
176  
-		} elseif (!in_array($table, $sources)) {
  177
+		} elseif (!$exists) {
177 178
 			$fixture->create($db);
  179
+		} else {
  180
+			$fixture->created[] = $db->configKeyName;
178 181
 		}
179 182
 	}
180 183
 

0 notes on commit 503bc06

Please sign in to comment.
Something went wrong with that request. Please try again.