當前位置: 首頁>>代碼示例>>PHP>>正文


PHP testing_initdataroot函數代碼示例

本文整理匯總了PHP中testing_initdataroot函數的典型用法代碼示例。如果您正苦於以下問題:PHP testing_initdataroot函數的具體用法?PHP testing_initdataroot怎麽用?PHP testing_initdataroot使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了testing_initdataroot函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: while

 // Check that the directory does not contains other things.
 if (!file_exists("{$CFG->behat_dataroot}/behattestdir.txt")) {
     if ($dh = opendir($CFG->behat_dataroot)) {
         while (($file = readdir($dh)) !== false) {
             if ($file === 'behat' or $file === '.' or $file === '..' or $file === '.DS_Store') {
                 continue;
             }
             behat_error(BEHAT_EXITCODE_CONFIG, '$CFG->behat_dataroot directory is not empty, ensure this is the directory where you want to install behat test dataroot');
         }
         closedir($dh);
         unset($dh);
         unset($file);
     }
     if (defined('BEHAT_UTIL')) {
         // Now we create dataroot directory structure for behat tests.
         testing_initdataroot($CFG->behat_dataroot, 'behat');
     } else {
         behat_error(BEHAT_EXITCODE_INSTALL);
     }
 }
 if (!defined('BEHAT_UTIL') and !defined('BEHAT_TEST')) {
     // Somebody tries to access test site directly, tell them if not enabled.
     if (!file_exists($CFG->behat_dataroot . '/behat/test_environment_enabled.txt')) {
         behat_error(BEHAT_EXITCODE_CONFIG, 'Behat is configured but not enabled on this test site.');
     }
 }
 // Constant used to inform that the behat test site is being used,
 // this includes all the processes executed by the behat CLI command like
 // the site reset, the steps executed by the browser drivers when simulating
 // a user session and a real session when browsing manually to $CFG->behat_wwwroot
 // like the browser driver does automatically.
開發者ID:janaece,項目名稱:globalclassroom4_clean,代碼行數:31,代碼來源:setup.php

示例2: drop_site

 /**
  * Drop all test site data.
  *
  * Note: To be used from CLI scripts only.
  *
  * @static
  * @param bool $displayprogress if true, this method will echo progress information.
  * @return void may terminate execution with exit code
  */
 public static function drop_site($displayprogress = false)
 {
     global $DB, $CFG;
     if (!self::is_test_site()) {
         phpunit_bootstrap_error(PHPUNIT_EXITCODE_CONFIGERROR, 'Can not drop non-test site!!');
     }
     // Purge dataroot
     if ($displayprogress) {
         echo "Purging dataroot:\n";
     }
     self::reset_dataroot();
     testing_initdataroot($CFG->dataroot, 'phpunit');
     self::drop_dataroot();
     // drop all tables
     self::drop_database($displayprogress);
 }
開發者ID:sumitnegi933,項目名稱:Moodle_lms_New,代碼行數:25,代碼來源:util.php

示例3: while

    }
}
if (!file_exists("{$CFG->phpunit_dataroot}/phpunittestdir.txt")) {
    if ($dh = opendir($CFG->phpunit_dataroot)) {
        while (($file = readdir($dh)) !== false) {
            if ($file === 'phpunit' or $file === '.' or $file === '..' or $file === '.DS_Store') {
                continue;
            }
            phpunit_bootstrap_error(PHPUNIT_EXITCODE_CONFIGERROR, '$CFG->phpunit_dataroot directory is not empty, can not run tests! Is it used for anything else?');
        }
        closedir($dh);
        unset($dh);
        unset($file);
    }
    // now we are 100% sure this dir is used only for phpunit tests
    testing_initdataroot($CFG->phpunit_dataroot, 'phpunit');
}
// verify db prefix
if (!isset($CFG->phpunit_prefix)) {
    phpunit_bootstrap_error(PHPUNIT_EXITCODE_CONFIGERROR, 'Missing $CFG->phpunit_prefix in config.php, can not run tests!');
}
if ($CFG->phpunit_prefix === '') {
    phpunit_bootstrap_error(PHPUNIT_EXITCODE_CONFIGERROR, '$CFG->phpunit_prefix can not be empty, can not run tests!');
}
if (isset($CFG->prefix) and $CFG->prefix === $CFG->phpunit_prefix) {
    phpunit_bootstrap_error(PHPUNIT_EXITCODE_CONFIGERROR, '$CFG->prefix and $CFG->phpunit_prefix must not be identical, can not run tests!');
}
// override CFG settings if necessary and throw away extra CFG settings
$CFG->wwwroot = 'http://www.example.com/moodle';
$CFG->dataroot = $CFG->phpunit_dataroot;
$CFG->prefix = $CFG->phpunit_prefix;
開發者ID:EmmanuelYupit,項目名稱:educursos,代碼行數:31,代碼來源:bootstrap.php


注:本文中的testing_initdataroot函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。