Hal\MutaTesting\Runner\Adapter\BaseAdapter::getSuiteResult PHP Method

getSuiteResult() public method

Get results of unit test suites by the file where the junit result is logged
public getSuiteResult ( string $logPath ) : Hal\MutaTesting\Test\UnitCollectionInterface
$logPath string
return Hal\MutaTesting\Test\UnitCollectionInterface
    public function getSuiteResult($logPath)
    {
        $factory = new JUnitFactory();
        if (!file_exists($logPath)) {
            throw new \Hal\MutaTesting\Test\Exception\TestSuiteNotFoundException(sprintf('results not found. Last command : "%s"', $this->getLastCommand()));
        }
        $content = file_get_contents($logPath);
        if (0 === strlen($content)) {
            throw new \Hal\MutaTesting\Test\Exception\TestSuiteNotFoundException(sprintf('results are empty. Last command : "%s"', $this->getLastCommand()));
        }
        try {
            $results = $factory->factory($content);
        } catch (\UnexpectedValueException $e) {
            throw new \LogicException(sprintf("Cannot get any informations about tests. There is probably no test with your configuration. \n[Executed command : %s]", $this->getLastCommand()));
        }
        return $results;
    }