/** * @param ControllerRoute $route * @return Controller */ protected function setRoute(ControllerRoute $route = null) { $this->route = $route; if (null !== $route) { if ($route->getViewDir()) { $this->viewDir = $route->getViewDir(); } $this->renderPartial = $route->isPartial(); if ($route->getExtension()) { $this->outputFormat = $route->getExtension(); } } return $this; }
public function testSetRequestParamsDetectsJsonPCallback() { $this->route->setRequestParams(array('callback' => 'myCallback')); $this->assertEquals('jsonp', $this->route->getExtension()); $this->assertEquals('myCallback', $this->route->getJsonPCallback()); }