当前位置: 首页>>代码示例>>PHP>>正文


PHP TestEnv::parseConfigFile方法代码示例

本文整理汇总了PHP中TestEnv::parseConfigFile方法的典型用法代码示例。如果您正苦于以下问题:PHP TestEnv::parseConfigFile方法的具体用法?PHP TestEnv::parseConfigFile怎么用?PHP TestEnv::parseConfigFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TestEnv的用法示例。


在下文中一共展示了TestEnv::parseConfigFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: restoreConfig

 /**
  * A method for re-parsing the testing environment configuration
  * file, to restore it in the event it needed to be changed
  * during a test.
  *
  * @todo Remove the audit hack
  */
 static function restoreConfig()
 {
     // Destroy cached table classes
     OA_DB_Table_Core::destroy();
     // Restore and Re-parse the config file
     $backupConfigFilename = $GLOBALS['_MAX']['TEST']['backupConfigFilename'];
     if (!empty($backupConfigFilename) && is_readable($backupConfigFilename)) {
         $configFile = TestEnv::getConfigFilename();
         copy($backupConfigFilename, $configFile);
     } else {
         OA::debug("Could not restore config file from backup: {$backupConfigFilename}");
     }
     $newConf = TestEnv::parseConfigFile();
     foreach ($newConf as $configGroup => $configGroupSettings) {
         foreach ($configGroupSettings as $confName => $confValue) {
             $GLOBALS['_MAX']['CONF'][$configGroup][$confName] = $confValue;
         }
     }
     // Switch off audit
     $GLOBALS['_MAX']['CONF']['audit']['enabled'] = false;
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:28,代码来源:TestEnv.php

示例2: runFile

 /** A method to run a single test file.
  *
  * @param string $layer  The name of a layer group to run.
  * @param string $folder The folder group to run, not including "tests/unit"
  * @param string $file   The file to run, including ".test.php"
  */
 function runFile($layer, $folder, $file)
 {
     $type = $GLOBALS['_MAX']['TEST']['test_type'];
     // Set up the environment for the test
     TestRunner::setupEnv($layer);
     $configBefore = TestEnv::parseConfigFile();
     // Add the test file to a SimpleTest group
     $testName = $this->_testName($layer, $folder, $file);
     $secondaryName = $this->_secondaryTestName($layer);
     $test = new GroupTest($testName, $secondaryName);
     $testFile = MAX_PROJECT_PATH . '/' . $folder . '/' . constant($type . '_TEST_STORE') . '/' . $file;
     $test->addTestFile($testFile);
     $this->runCase($test);
     // Tear down the environment for the test
     $configAfter = TestEnv::parseConfigFile();
     $configDiff = array_diff_assoc_recursive($configBefore, $configAfter);
     if (!empty($configDiff)) {
         OA::debug("Config file was changed by test: {$folder} {$file}", PEAR_LOG_DEBUG);
     }
     TestRunner::teardownEnv($layer);
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:27,代码来源:TestRunner.php


注:本文中的TestEnv::parseConfigFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。