public function run()
{
if (func_num_args()) {
throw new \LogicException('Calling TestCase::run($method) is deprecated. Use TestCase::runTest($method) instead.');
}
$methods = array_values(preg_grep(self::METHOD_PATTERN, array_map(function (\ReflectionMethod $rm) {
return $rm->getName();
}, (new \ReflectionObject($this))->getMethods())));
if (isset($_SERVER['argv']) && ($tmp = preg_filter('#--method=([\\w-]+)$#Ai', '$1', $_SERVER['argv']))) {
$method = reset($tmp);
if ($method === self::LIST_METHODS) {
Environment::$checkAssertions = FALSE;
header('Content-Type: text/plain');
echo '[' . implode(',', $methods) . ']';
return;
}
$this->runTest($method);
} else {
foreach ($methods as $method) {
$this->runTest($method);
}
}
}