/** * test custom AjaxView class is loaded and correct. * * @return void * @triggers Controller.startup $this->Controller */ public function testAjaxViewLoaded() { Router::extensions(['json', 'xml', 'ajax'], false); $this->Controller->request->params['_ext'] = 'ajax'; $event = new Event('Controller.startup', $this->Controller); $this->RequestHandler->initialize([]); $this->RequestHandler->startup($event); $this->assertEquals('Cake\\View\\AjaxView', $this->Controller->viewClass); $view = $this->Controller->createView(); $this->assertEquals('ajax', $view->layout); }