Пример #1
0
<?php

$output = [];
$output[] = 'Test Runner';
if (!defined('DS')) {
    define('DS', DIRECTORY_SEPARATOR);
}
$testRunnerPath = dirname(__FILE__);
require_once $testRunnerPath . DS . 'src' . DS . 'FileSystemTools.php';
require_once $testRunnerPath . DS . 'src' . DS . 'TestConfig.php';
require_once $testRunnerPath . DS . 'src' . DS . 'TestRunner.php';
require_once $testRunnerPath . DS . 'src' . DS . 'CmFiveInstaller.php';
require_once $testRunnerPath . DS . 'composer' . DS . 'vendor' . DS . 'autoload.php';
// overlay arguments and post variables onto configuration
TestConfig::init();
TestConfig::$config['testRunnerPath'] = $testRunnerPath;
// handle CLI arguments
if (php_sapi_name() == 'cli') {
    // set any legal parameters
    foreach ($argv as $aKey => $argument) {
        $argumentParts = explode(':', $argument);
        if (in_array(trim($argumentParts[0]), TestConfig::$legalParameters)) {
            TestConfig::$config[$argumentParts[0]] = implode(':', array_slice($argumentParts, 1));
        }
    }
    // handle POST vars
} else {
    die;
    // set any legal parameters
    foreach (TestConfig::$legalParameters as $key => $parameterName) {
        if (array_key_exists($parameterName, $_GET) && strlen(trim($_GET[$parameterName])) > 0) {
Пример #2
0
 public static function getConfig($key)
 {
     TestConfig::init();
     if (array_key_exists($key, self::$config)) {
         return str_replace('"', '', self::$config[$key]);
     }
 }