Permalink
Browse files

Fix notice error for fixtures with imported tables.

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 e3b870dbf707eb8f8b7f2757dfd454e9992b6c7a
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/Cake/TestSuite/Fixture/CakeTestFixture.php
@@ -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;

0 comments on commit e3b870d

Please sign in to comment.