summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-12-03 03:49:45 +0000
committerBharat Mediratta <bharat@menalto.com>2008-12-03 03:49:45 +0000
commit844e5573f0ce27f716f33a6e450a69a5d281a4d2 (patch)
treee849a65fd20a32c375a11e73e116df3462e63eac
parent705698a425bf00f7294a2e9eee8065fcadfffde5 (diff)
Make sure that the dev is not using the same db for tests as they are for production (this one's for you, valiant!)
-rw-r--r--modules/gallery_unit_test/controllers/gallery_unit_test.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/gallery_unit_test/controllers/gallery_unit_test.php b/modules/gallery_unit_test/controllers/gallery_unit_test.php
index 1185fb95..2d70aad8 100644
--- a/modules/gallery_unit_test/controllers/gallery_unit_test.php
+++ b/modules/gallery_unit_test/controllers/gallery_unit_test.php
@@ -37,6 +37,13 @@ class Gallery_Unit_Test_Controller extends Controller {
return;
}
+ if ($db_config['default']['connection']['database'] ==
+ $db_config['unit_test']['connection']['database']) {
+ print "Don't use the default database for your unit tests or you'll lose all your data.\n";
+ print "Try using '{$db_config['default']['connection']['database']}_test' in $test_config\n";
+ return;
+ }
+
try {
$db = Database::instance('unit_test');
$db->connect();