public function run($path = null, array $options = array(), $logFile = null, $prependFile = null, callable $callback = null)
{
// path
if (null !== $path) {
if (is_dir($path)) {
$options[] = sprintf('-d %s', $path);
} else {
$options[] = sprintf('-f %s', $path);
}
$path = null;
}
if (!is_null($logFile)) {
$bin = trim(preg_replace('!(php\\s+)!i', '', $this->binary));
$content = sprintf('?><?php require_once "%s"; ', realpath($bin) ? realpath($bin) : getcwd() . $this->binary) . sprintf('$writer = new \\mageekguy\\atoum\\writers\\file("%s");', $logFile) . '$xunit = new \\mageekguy\\atoum\\reports\\asynchronous\\xunit();' . '$xunit->addWriter($writer);' . '$runner->addReport($xunit);' . '?>';
$this->addInConfiguration($content, $options);
}
if (!is_null($prependFile)) {
$this->addInBootstrap(null, $options, $prependFile);
}
return parent::run(null, $options, null, null, $callback);
}