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


PHP ExampleEvent::getMessage方法代码示例

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


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

示例1: array

 function it_writes_a_fail_message_for_a_failing_example(Template $template, ExampleEvent $event, Presenter $presenter)
 {
     $event->getTitle()->willReturn(self::EVENT_TITLE);
     $event->getMessage()->willReturn(self::EVENT_MESSAGE);
     $event->getBacktrace()->willReturn(self::$BACKTRACE);
     $event->getException()->willReturn(new \Exception());
     $template->render(Template::DIR . '/Template/ReportFailed.html', array('title' => self::EVENT_TITLE, 'message' => self::EVENT_MESSAGE, 'backtrace' => self::BACKTRACE, 'code' => self::CODE, 'index' => 1, 'specification' => 1))->shouldBeCalled();
     $presenter->presentException(Argument::cetera())->willReturn(self::CODE);
     $this->write(1);
 }
开发者ID:edwardricardo,项目名称:zenska,代码行数:10,代码来源:ReportFailedItemSpec.php

示例2: afterExample

 /**
  * @param ExampleEvent $event
  */
 public function afterExample(ExampleEvent $event)
 {
     $io = $this->getIO();
     $output = ob_get_clean();
     if ($output) {
         $io->writeln($this->teamCityMessage("testStdOut", array("name" => $event->getTitle(), "out" => "Test Output\n>>>>>>>>>>>\n{$output}\n<<<<<<<<<<<\n")));
     }
     switch ($event->getResult()) {
         case ExampleEvent::PASSED:
             break;
         case ExampleEvent::PENDING:
             $io->writeln($this->teamCityMessage('testIgnored', array('name' => $event->getTitle(), 'details' => $event->getMessage())));
             break;
         case ExampleEvent::FAILED:
             $io->writeln($this->teamCityMessage('testFailed', array('name' => $event->getTitle(), 'message' => "Failed Test\n\n" . $event->getMessage(), 'details' => $event->getException()->getTraceAsString())));
             break;
         case ExampleEvent::BROKEN:
             $io->writeln($this->teamCityMessage('testFailed', array('name' => $event->getTitle(), 'message' => "Broken Test\n\n" . $event->getMessage(), 'details' => $event->getException()->getTraceAsString())));
             break;
     }
     $io->writeln($this->teamCityMessage('testFinished', array('name' => $event->getTitle())));
 }
开发者ID:ascii-soup,项目名称:phpspec-teamcity-formatter,代码行数:25,代码来源:TeamCityFormatter.php

示例3: write

 /**
  *
  * @param int $index        	
  */
 public function write($index)
 {
     $code = $this->presenter->presentException($this->event->getException(), true);
     $this->template->render(Template::DIR . '/Template/ReportFailed.html', array('title' => htmlentities(strip_tags($this->event->getTitle())), 'message' => htmlentities(strip_tags($this->event->getMessage())), 'backtrace' => $this->formatBacktrace(), 'code' => $code, 'index' => self::$failingExamplesCount++, 'specification' => $index));
 }
开发者ID:ngitimfoyo,项目名称:Nyari-AppPHP,代码行数:9,代码来源:ReportFailedItem.php

示例4: write

 /**
  *
  */
 public function write()
 {
     $this->template->render(Template::DIR . '/Template/ReportSkipped.html', array('title' => htmlentities(strip_tags($this->event->getTitle())), 'message' => htmlentities(strip_tags($this->event->getMessage()))));
 }
开发者ID:umpirsky,项目名称:phpspec,代码行数:7,代码来源:ReportSkippedItem.php


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