function it_outputs_progress_as_33_when_3_of_3_examples_have_run_and_one_passed(ExampleEvent $event, IO $io, StatisticsCollector $stats)
 {
     $stats->getEventsCount()->willReturn(3);
     $stats->getCountsHash()->willReturn(array('passed' => 1, 'pending' => 0, 'skipped' => 0, 'failed' => 2, 'broken' => 0));
     $stats->getTotalSpecs()->willReturn(3);
     $stats->getTotalSpecsCount()->willReturn(3);
     $this->afterExample($event);
     $expected = '/  skipped: 0%  /  pending: 0%  /  passed: 33%  /  failed: 66%  /  broken: 0%   /  3 examples';
     $io->writeTemp($expected)->shouldHaveBeenCalled();
 }
Beispiel #2
0
 function it_outputs_a_suite_summary(SuiteEvent $event, ConsoleIO $io, StatisticsCollector $stats)
 {
     $stats->getEventsCount()->willReturn(1);
     $stats->getFailedEvents()->willReturn(array());
     $stats->getBrokenEvents()->willReturn(array());
     $stats->getPendingEvents()->willReturn(array());
     $stats->getSkippedEvents()->willReturn(array());
     $stats->getTotalSpecs()->willReturn(15);
     $event->getTime()->willReturn(12.345);
     $stats->getCountsHash()->willReturn(array('passed' => 1, 'pending' => 0, 'skipped' => 0, 'failed' => 2, 'broken' => 0));
     $this->afterSuite($event);
     $io->writeln('15 specs')->shouldHaveBeenCalled();
     $io->writeln("\n12345ms")->shouldHaveBeenCalled();
     $io->write('1 example ')->shouldHaveBeenCalled();
     $expected = '(<passed>1 passed</passed>, <failed>2 failed</failed>)';
     $io->write($expected)->shouldHaveBeenCalled();
 }