Browse Source

Add logging and error when fixture creation fails.

This helps people find and solve issues faster/easier.

Fixes #3044
mark_story 13 years ago
parent
commit
3b46cd43f1
1 changed files with 8 additions and 0 deletions
  1. 8 0
      lib/Cake/TestSuite/Fixture/CakeTestFixture.php

+ 8 - 0
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;