Exemplo n.º 1
0
 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(HtmlTemplate::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);
 }
Exemplo n.º 2
0
 /**
  *
  * @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));
 }
Exemplo n.º 3
0
 /**
  */
 public function write()
 {
     $this->template->render(Template::DIR . '/Template/ReportPending.html', array('title' => $this->event->getTitle(), 'pendingExamplesCount' => self::$pendingExamplesCount));
     self::$pendingExamplesCount++;
 }
Exemplo n.º 4
0
 function it_writes_a_pass_message_for_a_passing_example(Template $template, ExampleEvent $event)
 {
     $event->getTitle()->willReturn(self::EVENT_TITLE);
     $template->render(HtmlTemplate::DIR . '/Template/ReportPass.html', array('title' => self::EVENT_TITLE))->shouldBeCalled();
     $this->write();
 }
Exemplo n.º 5
0
 /**
  *
  */
 public function write()
 {
     $this->template->render(Template::DIR . '/Template/ReportPass.html', array('title' => $this->event->getTitle()));
 }
Exemplo n.º 6
0
 /**
  *
  */
 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()))));
 }