public function afterSuite() { if ($this->coverageSession) { $this->coverageSession->saveState(); } $this->session->stop(); }
/** * @return ResultEvent[] */ private function doRunAll() { $results = array(); $arguments = $this->runAllArgs; $this->session = Session::create(); if ($this->isFailed()) { $rerunFile = $this->session->generateRerunFile(); $arguments[] = '--rerun=' . $rerunFile; } $builder = new ProcessBuilder($arguments); $this->getRunner()->run($builder); $this->session = Session::create(); if (!$this->isFailed()) { $results[] = ResultEvent::createSucceed(static::RUN_ALL_SUCCESS_MESSAGE); } else { $results = $this->session->getResults(); $results[] = ResultEvent::createFailed(static::RUN_ALL_FAILED_MESSAGE); } return $results; }
public function registerSubscriber(ContainerBuilder $container) { $definition = new Definition('PhpGuard\\Plugins\\Behat\\Bridge\\BehatEventListener', array($this->coverageSession, Session::create())); $definition->addTag('behat.event_subscriber'); $container->setDefinition('behat.event_subscriber.phpguard', $definition); }
function it_should_add_feature_result_to_session_on_afterFeature_event(FeatureEvent $event, Session $session) { $session->addResult($event)->shouldBeCalled(); $this->afterFeature($event); }