function it_outputs_monkey_when_example_is_pending(IO $io, ExampleEvent $event)
 {
     $event->getResult()->willReturn(ExampleEvent::PENDING);
     $this->outputEmoji($event);
     $io->write(mb_convert_encoding('🙉', 'UTF-8', 'HTML-ENTITIES'))->shouldHaveBeenCalled();
     $io->write(' ')->shouldHaveBeenCalled();
 }
 public function outputEmoji(ExampleEvent $event)
 {
     switch ($event->getResult()) {
         case ExampleEvent::PASSED:
             $this->io->write($this->encodeChar('😄'));
             break;
         case ExampleEvent::FAILED:
             $this->io->write($this->encodeChar('💩'));
             break;
         case ExampleEvent::BROKEN:
             $this->io->write($this->encodeChar('🔥'));
             break;
         case ExampleEvent::SKIPPED:
             $this->io->write($this->encodeChar('🙈'));
             break;
         case ExampleEvent::PENDING:
             $this->io->write($this->encodeChar('🙉'));
             break;
     }
     $this->io->write(' ');
 }
Exemple #3
0
 function it_outputs_a_suite_summary(SuiteEvent $event, IO $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();
 }
 function it_escapes_unicode_symbols(IO $io, ExampleNode $node)
 {
     $node->getTitle()->willReturn("Example 0x1234");
     $io->write("##teamcity[testIgnored name='Example |0x1234' message='Exception |0x4321!']\n")->shouldBeCalled();
     $this->afterExample($this->exampleEvent($node, ExampleEvent::PENDING, 0, 'Exception 0x4321!'));
 }