Skip to content
Browse files

Merge branch 'w04_MDL-37713_m23_testdir' of git://github.com/skodak/m…

…oodle into MOODLE_23_STABLE
  • Loading branch information...
2 parents c01e5b0 + 1892098 commit ab9008ffb0e9f62a927c67f64373cc9bd2c47e66 Sam Hemelryk committed Jan 28, 2013
Showing with 8 additions and 5 deletions.
  1. +8 −5 lib/phpunit/bootstrap.php
View
13 lib/phpunit/bootstrap.php
@@ -93,19 +93,22 @@
if (!isset($CFG->phpunit_dataroot)) {
phpunit_bootstrap_error(PHPUNIT_EXITCODE_CONFIGERROR, 'Missing $CFG->phpunit_dataroot in config.php, can not run tests!');
}
-// Ensure we access to phpunit_dataroot realpath always.
-$CFG->phpunit_dataroot = realpath($CFG->phpunit_dataroot);
-if (isset($CFG->dataroot) and $CFG->phpunit_dataroot === $CFG->dataroot) {
- phpunit_bootstrap_error(PHPUNIT_EXITCODE_CONFIGERROR, '$CFG->dataroot and $CFG->phpunit_dataroot must not be identical, can not run tests!');
-}
+// Create test dir if does not exists yet.
if (!file_exists($CFG->phpunit_dataroot)) {
mkdir($CFG->phpunit_dataroot, $CFG->directorypermissions);
}
if (!is_dir($CFG->phpunit_dataroot)) {
phpunit_bootstrap_error(PHPUNIT_EXITCODE_CONFIGERROR, '$CFG->phpunit_dataroot directory can not be created, can not run tests!');
}
+// Ensure we access to phpunit_dataroot realpath always.
+$CFG->phpunit_dataroot = realpath($CFG->phpunit_dataroot);
+
+if (isset($CFG->dataroot) and $CFG->phpunit_dataroot === $CFG->dataroot) {
+ phpunit_bootstrap_error(PHPUNIT_EXITCODE_CONFIGERROR, '$CFG->dataroot and $CFG->phpunit_dataroot must not be identical, can not run tests!');
+}
+
if (!is_writable($CFG->phpunit_dataroot)) {
// try to fix permissions if possible
if (function_exists('posix_getuid')) {

0 comments on commit ab9008f

Please sign in to comment.
Something went wrong with that request. Please try again.