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); }
/** * * @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)); }
/** */ public function write() { $this->template->render(Template::DIR . '/Template/ReportPending.html', array('title' => $this->event->getTitle(), 'pendingExamplesCount' => self::$pendingExamplesCount)); self::$pendingExamplesCount++; }
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(); }
/** * */ public function write() { $this->template->render(Template::DIR . '/Template/ReportPass.html', array('title' => $this->event->getTitle())); }
/** * */ 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())))); }