From e3b870dbf707eb8f8b7f2757dfd454e9992b6c7a Mon Sep 17 00:00:00 2001 From: mark_story Date: Sun, 3 Mar 2013 20:59:09 -0500 Subject: [PATCH] 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 --- lib/Cake/TestSuite/Fixture/CakeTestFixture.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Cake/TestSuite/Fixture/CakeTestFixture.php b/lib/Cake/TestSuite/Fixture/CakeTestFixture.php index 1fa2f2468..ca8baa9b3 100644 --- a/lib/Cake/TestSuite/Fixture/CakeTestFixture.php +++ b/lib/Cake/TestSuite/Fixture/CakeTestFixture.php @@ -283,7 +283,11 @@ class CakeTestFixture { $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;