public function run($files) { $specFiles = implode(',', $files); $command = $this->cmdRun . ' --spec-files=' . $specFiles; $this->logger->addCommon('Running for files', $files); $runner = $this->getRunner(); $arguments = explode(' ', $command); $builder = new ProcessBuilder($arguments); $process = $runner->run($builder); $results = $this->renderResult(); if (0 === $process->getExitCode()) { foreach ($files as $file) { $file = rtrim(str_replace(getcwd(), '', $file), '\\/'); $results[] = ResultEvent::createSucceed('Succeed: <highlight>' . $file . '</highlight>'); } if ($this->options['all_after_pass']) { $this->logger->addSuccess('Run all specs after pass'); $allSpecs = $this->doRunAll(); $results = array_merge($results, $allSpecs); } } $event = new ProcessEvent($this->container->get('plugins.phpspec'), $results); if (count($this->failed) > 0) { $this->container->setParameter('application.exit_code', ResultEvent::FAILED); } return $event; }
private function reportClover($target) { /* @var \PHP_CodeCoverage_Report_Clover $report */ $relative = str_replace(getcwd() . DIRECTORY_SEPARATOR, '', $target); $this->logger->addCommon(sprintf('Generating clover output to: <comment>%s</comment> please wait!', $relative)); $report = new \PHP_CodeCoverage_Report_Clover(); $report->process($this->coverage, $target); }