Changeset View
Changeset View
Standalone View
Standalone View
src/unit/engine/PhpunitTestEngine.php
| Show All 36 Lines | foreach ($this->getPaths() as $path) { | ||||
| if ($test = $this->findTestFile($path)) { | if ($test = $this->findTestFile($path)) { | ||||
| $this->affectedTests[$path] = $test; | $this->affectedTests[$path] = $test; | ||||
| } | } | ||||
| } | } | ||||
| if (empty($this->affectedTests)) { | if (empty($this->affectedTests)) { | ||||
| throw new ArcanistNoEffectException('No tests to run.'); | throw new ArcanistNoEffectException(pht('No tests to run.')); | ||||
| } | } | ||||
| $this->prepareConfigFile(); | $this->prepareConfigFile(); | ||||
| $futures = array(); | $futures = array(); | ||||
| $tmpfiles = array(); | $tmpfiles = array(); | ||||
| foreach ($this->affectedTests as $class_path => $test_path) { | foreach ($this->affectedTests as $class_path => $test_path) { | ||||
| if (!Filesystem::pathExists($test_path)) { | if (!Filesystem::pathExists($test_path)) { | ||||
| continue; | continue; | ||||
| ▲ Show 20 Lines • Show All 201 Lines • ▼ Show 20 Lines | private function prepareConfigFile() { | ||||
| $project_root = $this->projectRoot.DIRECTORY_SEPARATOR; | $project_root = $this->projectRoot.DIRECTORY_SEPARATOR; | ||||
| $config = $this->getConfigurationManager()->getConfigFromAnySource( | $config = $this->getConfigurationManager()->getConfigFromAnySource( | ||||
| 'phpunit_config'); | 'phpunit_config'); | ||||
| if ($config) { | if ($config) { | ||||
| if (Filesystem::pathExists($project_root.$config)) { | if (Filesystem::pathExists($project_root.$config)) { | ||||
| $this->configFile = $project_root.$config; | $this->configFile = $project_root.$config; | ||||
| } else { | } else { | ||||
| throw new Exception('PHPUnit configuration file was not '. | throw new Exception( | ||||
| 'found in '.$project_root.$config); | pht( | ||||
| 'PHPUnit configuration file was not found in %s', | |||||
| $project_root.$config)); | |||||
| } | } | ||||
| } | } | ||||
| $bin = $this->getConfigurationManager()->getConfigFromAnySource( | $bin = $this->getConfigurationManager()->getConfigFromAnySource( | ||||
| 'unit.phpunit.binary'); | 'unit.phpunit.binary'); | ||||
| if ($bin) { | if ($bin) { | ||||
| if (Filesystem::binaryExists($bin)) { | if (Filesystem::binaryExists($bin)) { | ||||
| $this->phpunitBinary = $bin; | $this->phpunitBinary = $bin; | ||||
| } else { | } else { | ||||
| $this->phpunitBinary = Filesystem::resolvePath($bin, $project_root); | $this->phpunitBinary = Filesystem::resolvePath($bin, $project_root); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||