From 6046f1c8f15c84f383034acf1c0887b83dd19a27 Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Wed, 4 Dec 2013 10:59:49 +0800 Subject: [PATCH] MDL-43185 behat: Use realpath on existing paths --- lib/behat/lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/behat/lib.php b/lib/behat/lib.php index 7539e3d663a..667125ee138 100644 --- a/lib/behat/lib.php +++ b/lib/behat/lib.php @@ -198,12 +198,13 @@ function behat_check_config_vars() { // CFG->behat_dataroot must be set and with value different than CFG->dataroot and phpunit_dataroot. $CFG->dataroot = realpath($CFG->dataroot); - if (!empty($CFG->behat_dataroot)) { + if (!empty($CFG->behat_dataroot) && is_dir($CFG->behat_dataroot)) { $CFG->behat_dataroot = realpath($CFG->behat_dataroot); } if (empty($CFG->behat_dataroot) || ($CFG->behat_dataroot == $CFG->dataroot) || - (!empty($CFG->phpunit_dataroot) && $CFG->behat_dataroot == $CFG->phpunit_dataroot)) { + (!empty($CFG->phpunit_dataroot) && is_dir($CFG->phpunit_dataroot) + && $CFG->behat_dataroot == realpath($CFG->phpunit_dataroot))) { behat_error(BEHAT_EXITCODE_CONFIG, 'Define $CFG->behat_dataroot in config.php with a value different than $CFG->dataroot and $CFG->phpunit_dataroot'); }