Skip to content

Commit

Permalink
Fix notice error for fixtures with imported tables.
Browse files Browse the repository at this point in the history
Don't emit an error when a fixture has an imported table with no primary.

Fixes #3659
  • Loading branch information
markstory committed Mar 4, 2013
1 parent c1c9a9d commit e3b870d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Cake/TestSuite/Fixture/CakeTestFixture.php
Expand Up @@ -283,7 +283,11 @@ public function insert($db) {
$nested = $db->useNestedTransactions;
$db->useNestedTransactions = false;
$result = $db->insertMulti($this->table, $fields, $values);
if ($this->primaryKey && in_array($this->fields[$this->primaryKey]['type'], array('integer', 'biginteger'))) {
if (
$this->primaryKey &&
isset($this->fields[$this->primaryKey]['type']) &&
in_array($this->fields[$this->primaryKey]['type'], array('integer', 'biginteger'))
) {
$db->resetSequence($this->table, $this->primaryKey);
}
$db->useNestedTransactions = $nested;
Expand Down

0 comments on commit e3b870d

Please sign in to comment.