Permalink
Browse files

Tweak the test setup code to always copy database.php; something is

going wrong that's nuking test/var/database.php -- I'll figure that
out, but in the meantime we can make this code more robust.
  • Loading branch information...
1 parent 4ba02ad commit f1eed778e47604670e186d48c02659050aadf566 @bharat bharat committed Jun 8, 2010
Showing with 4 additions and 3 deletions.
  1. +4 −3 index.php
View
@@ -64,11 +64,12 @@
case "test":
array_splice($_SERVER["argv"], 1, 1, "gallery_unit_test");
define("TEST_MODE", 1);
- define("VARPATH", realpath("test/var") . "/");
- if (!is_dir("test/var/logs")) {
+ if (!is_dir("test/var")) {
+ @mkdir("test/var", 0777, true);
@mkdir("test/var/logs", 0777, true);
- @copy("var/database.php", VARPATH . "database.php");
}
+ @copy("var/database.php", "test/var/database.php");
+ define("VARPATH", realpath("test/var") . "/");
break;
default:

0 comments on commit f1eed77

Please sign in to comment.