getTime() public method

public getTime ( ) : float
return float
示例#1
0
 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));
 }
示例#2
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();
 }
 public function afterSpecification(SpecificationEvent $event)
 {
     $this->logger->logSpecification($event->getTitle(), $event->getTime());
 }