function it_aggregates_testcase_nodes_and_store_them_after_specification_run(SpecificationEvent $event) { $event->getTitle()->willReturn('specification title'); $event->getTime()->willReturn(42); $this->setTestCaseNodes(array('<testcase name="example1" />', '<testcase name="example2" />', '<testcase name="example3" />')); $this->setExampleStatusCounts(array(ExampleEvent::FAILED => 1, ExampleEvent::BROKEN => 2, ExampleEvent::PENDING => 5, ExampleEvent::SKIPPED => 3)); $this->afterSpecification($event); $this->getTestSuiteNodes()->shouldReturn(array('<testsuite name="specification title" time="42.000000" tests="3" failures="1" errors="2" skipped="8">' . "\n" . '<testcase name="example1" />' . "\n" . '<testcase name="example2" />' . "\n" . '<testcase name="example3" />' . "\n" . '</testsuite>')); $this->getTestCaseNodes()->shouldHaveCount(0); $this->getExampleStatusCounts()->shouldReturn(array(ExampleEvent::PASSED => 0, ExampleEvent::PENDING => 0, ExampleEvent::SKIPPED => 0, ExampleEvent::FAILED => 0, ExampleEvent::BROKEN => 0)); }
/** * {@inheritdoc} */ public function afterSpecification(SpecificationEvent $event) { $this->testSuiteNodes[] = sprintf('<testsuite name="%s" time="%s" tests="%s" failures="%s" errors="%s" skipped="%s">' . "\n" . '%s' . "\n" . '</testsuite>', $event->getTitle(), $event->getTime(), count($this->testCaseNodes), $this->exampleStatusCounts[ExampleEvent::FAILED], $this->exampleStatusCounts[ExampleEvent::BROKEN], $this->exampleStatusCounts[ExampleEvent::PENDING], implode("\n", $this->testCaseNodes)); $this->initTestCaseNodes(); }
/** * @param SpecificationEvent $specification */ public function beforeSpecification(SpecificationEvent $specification) { $index = $this->index++; $name = $specification->getTitle(); include __DIR__ . "/Html/Template/ReportSpecificationStarts.html"; }
public function afterSpecification(SpecificationEvent $event) { $this->getIO()->writeln($this->teamCityMessage('testSuiteFinished', array('name' => $event->getTitle()))); }
public function afterSpecification(SpecificationEvent $event) { $this->logger->logSpecification($event->getTitle(), $event->getTime()); }