From 3b46cd43f1279b7d24c58861466c414e0eb8d72c Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 17 Jul 2012 22:48:50 -0400 Subject: [PATCH] Add logging and error when fixture creation fails. This helps people find and solve issues faster/easier. Fixes #3044 --- lib/Cake/TestSuite/Fixture/CakeTestFixture.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Cake/TestSuite/Fixture/CakeTestFixture.php b/lib/Cake/TestSuite/Fixture/CakeTestFixture.php index 359d57f6f..db16cfff6 100644 --- a/lib/Cake/TestSuite/Fixture/CakeTestFixture.php +++ b/lib/Cake/TestSuite/Fixture/CakeTestFixture.php @@ -194,6 +194,14 @@ class CakeTestFixture { $db->execute($db->createSchema($this->Schema), array('log' => false)); $this->created[] = $db->configKeyName; } catch (Exception $e) { + $msg = __d( + 'cake_dev', + 'Fixture creation for "%s" failed "%s"', + $this->table, + $e->getMessage() + ); + CakeLog::error($msg); + trigger_error($msg, E_USER_WARNING); return false; } return true;