public function getRequestFormat($default = 'html') { if (null === $this->format) { $this->format = $this->attributes->get('_format', $default); } return $this->format; }
function it_checks_if_its_a_html_request(Request $request) { $request->getRequestFormat()->willReturn('html'); $this->isHtmlRequest()->shouldReturn(true); $request->getRequestFormat()->willReturn('json'); $this->isHtmlRequest()->shouldReturn(false); }