当前位置: 首页>>代码示例>>PHP>>正文


PHP IO::write方法代码示例

本文整理汇总了PHP中PhpSpec\Console\IO::write方法的典型用法代码示例。如果您正苦于以下问题:PHP IO::write方法的具体用法?PHP IO::write怎么用?PHP IO::write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhpSpec\Console\IO的用法示例。


在下文中一共展示了IO::write方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

 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();
 }
开发者ID:ciaranmcnulty,项目名称:phpspec-emoji-formatter,代码行数:7,代码来源:EmojiFormatterSpec.php

示例2: outputEmoji

 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(' ');
 }
开发者ID:ciaranmcnulty,项目名称:phpspec-emoji-formatter,代码行数:21,代码来源:EmojiFormatter.php

示例3:

 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();
 }
开发者ID:focuslife,项目名称:v0.1,代码行数:17,代码来源:DotFormatterSpec.php

示例4:

 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!'));
 }
开发者ID:pawel-grzona,项目名称:teamcity-phpspec-extension,代码行数:6,代码来源:FormatterSpec.php


注:本文中的PhpSpec\Console\IO::write方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。