本文整理汇总了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);
}
示例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())));
}
示例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));
}
示例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()))));
}