public function runTestMethods(array $methods, array $tags = array())
{
$this->runTestMethods = $runTestMethods = array();
if (isset($methods['*']) === true) {
$runTestMethods = $methods['*'];
}
$testClass = $this->getClass();
if (isset($methods[$testClass]) === true) {
$runTestMethods = $methods[$testClass];
}
if (in_array('*', $runTestMethods) === true) {
$runTestMethods = array();
}
if (sizeof($runTestMethods) <= 0) {
$runTestMethods = $this->getTestMethods($tags);
} else {
$runTestMethods = $this->getTaggedTestMethods($runTestMethods, $tags);
}
foreach ($runTestMethods as $method) {
if ($this->xdebugConfig != null) {
$engineClass = 'mageekguy\\atoum\\test\\engines\\concurrent';
} else {
$engineName = $engineClass = $this->getMethodEngine($method) ?: $this->getClassEngine() ?: self::getDefaultEngine();
if (substr($engineClass, 0, 1) !== '\\') {
$engineClass = self::enginesNamespace . '\\' . $engineClass;
}
if (class_exists($engineClass) === false) {
throw new exceptions\runtime('Test engine \'' . $engineName . '\' does not exist for method \'' . $this->class . '::' . $method . '()\'');
}
}
$engine = new $engineClass();
if ($engine instanceof test\engine === false) {
throw new exceptions\runtime('Test engine \'' . $engineName . '\' is invalid for method \'' . $this->class . '::' . $method . '()\'');
}
$this->runTestMethods[$method] = $engine;
}
return $this;
}