final class PhpunitTestEngine extends ArcanistBaseUnitTestEngine {
private $configFile;
+ private $phpunitBinary = 'phpunit';
private $affectedTests;
private $projectRoot;
$config = $this->configFile ? csprintf('-c %s', $this->configFile) : null;
- $futures[$test_path] = new ExecFuture('phpunit %C --log-json %s %C %s',
- $config, $json_tmp, $clover, $test_path);
+ $futures[$test_path] = new ExecFuture('%C %C --log-json %s %C %s',
+ $this->phpunitBinary, $config, $json_tmp, $clover, $test_path);
$tmpfiles[$test_path] = array(
'json' => $json_tmp,
'clover' => $clover_tmp,
'found in ' . $project_root . $config);
}
}
+ if ($bin = $this->getWorkingCopy()->getConfig('unit.phpunit.binary')) {
+ if (Filesystem::binaryExists($bin)) {
+ $this->phpunitBinary = $bin;
+ }
+ else {
+ $this->phpunitBinary = Filesystem::resolvePath($bin, $project_root);
+ }
+ }
}
}