MDL-38307 behat: Remove notices
authorDavid Monllao <david.monllao@gmail.com>
Mon, 4 Mar 2013 09:13:06 +0000 (17:13 +0800)
committerDavid Monllao <davidm@moodle.com>
Fri, 8 Mar 2013 04:29:59 +0000 (12:29 +0800)
admin/tool/behat/cli/util.php

index e4e3d6e..a69fa08 100644 (file)
@@ -90,19 +90,17 @@ ini_set('log_errors', '1');
 require_once(__DIR__ . '/../../../../config.php');
 
 // CFG->behat_prefix must be set and with value different than CFG->prefix and phpunit_prefix.
-if (!isset($CFG->behat_prefix) ||
-   (isset($CFG->behat_prefix) &&
-       ($CFG->behat_prefix == $CFG->prefix ||
-       $CFG->behat_prefix == $CFG->phpunit_prefix))) {
+if (empty($CFG->behat_prefix) ||
+       ($CFG->behat_prefix == $CFG->prefix) ||
+       (!empty($CFG->phpunit_prefix) && $CFG->behat_prefix == $CFG->phpunit_prefix)) {
     behat_error(BEHAT_EXITCODE_CONFIG,
         'Define $CFG->behat_prefix in config.php with a value different than $CFG->prefix and $CFG->phpunit_prefix');
 }
 
 // CFG->behat_dataroot must be set and with value different than CFG->dataroot and phpunit_dataroot.
-if (!isset($CFG->behat_dataroot) ||
-   (isset($CFG->behat_dataroot) &&
-       ($CFG->behat_dataroot == $CFG->dataroot ||
-       $CFG->behat_dataroot == $CFG->phpunit_dataroot))) {
+if (empty($CFG->behat_dataroot) ||
+       ($CFG->behat_dataroot == $CFG->dataroot) ||
+       (!empty($CFG->phpunit_dataroot) && $CFG->behat_dataroot == $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');
 }