Add logging and error when fixture creation fails.

This helps people find and solve issues faster/easier.

Fixes #3044
This commit is contained in:
mark_story 2012-07-17 22:48:50 -04:00
parent a63dd9ee9d
commit 3b46cd43f1

View file

@ -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;