Пример #1
0
 /** 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);
 }