Browse files

Remove key-ordering sensitivity in fixtures

Previously, the field order was effectively taken from the last record in the fixture, but the values were ordered according to the array_unique call above - primarily determined by the first record in the fixture.  If these two orders differed, values were added under the wrong keys.
  • Loading branch information...
1 parent 246c09a commit 12a142d0ca07153c1574f21b205c020ee9efca90 @cincodenada cincodenada committed Mar 14, 2013
Showing with 0 additions and 1 deletion.
  1. +0 −1 lib/Cake/TestSuite/Fixture/CakeTestFixture.php
@@ -277,7 +277,6 @@ public function insert($db) {
$fields = array_unique($fields);
$default = array_fill_keys($fields, null);
foreach ($this->records as $record) {
- $fields = array_keys($record);
$values[] = array_values(array_merge($default, $record));
$nested = $db->useNestedTransactions;

0 comments on commit 12a142d

Please sign in to comment.