Permalink
Browse files

Improve error message.

Fixture datasources must begin with test so you don't accidentally use
a real datasource.

Fixes #3254
  • Loading branch information...
1 parent 0fb4d1d commit 972d5752bfe3102a2b756b8d2425c83ba617410a @markstory markstory committed Oct 5, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/Cake/TestSuite/Fixture/CakeTestFixture.php
@@ -75,7 +75,13 @@ public function __construct() {
if (!empty($this->useDbConfig)) {
$connection = $this->useDbConfig;
if (strpos($connection, 'test') !== 0) {
- throw new CakeException(__d('cake_dev', 'Invalid datasource %s for object %s', $connection, $this->name));
+ $message = __d(
+ 'cake_dev',
+ 'Invalid datasource name "%s" for "%s" fixture. Fixture datasource names must begin with "test".',
+ $connection,
+ $this->name
+ );
+ throw new CakeException($message);
}
}
$this->Schema = new CakeSchema(array('name' => 'TestSuite', 'connection' => $connection));

0 comments on commit 972d575

Please sign in to comment.