5 * Parse phpunit result files
9 protected $envTestSuite;
12 * @param string $phpunit
13 * @param string $envTestSuite
15 public function __construct($phpunit = "phpunit", $envTestSuite = 'EnvTests') {
16 $this->phpunit
= $phpunit;
17 $this->envTestSuite
= $envTestSuite;
23 * (string $testName => string $status)
25 public function run($tests) {
26 $envTests = implode(' ', $tests);
27 $jsonFile = tempnam(sys_get_temp_dir(), 'phpunit-json-');
29 $command = "env PHPUNIT_TESTS=\"$envTests\" {$this->phpunit} --log-json $jsonFile {$this->envTestSuite}";
30 echo "Running [$command]\n";
32 $results = PHPUnitParser
::parseJsonResults(file_get_contents($jsonFile));