/** * testViewClassMap method * * @return void */ public function testViewClassMap() { $this->RequestHandler->settings = array('viewClassMap' => array('json' => 'CustomJson')); $this->RequestHandler->initialize($this->Controller); $result = $this->RequestHandler->viewClassMap(); $expected = array('json' => 'CustomJson', 'xml' => 'Xml'); $this->assertEquals($expected, $result); $result = $this->RequestHandler->viewClassMap('xls', 'Excel.Excel'); $expected = array('json' => 'CustomJson', 'xml' => 'Xml', 'xls' => 'Excel.Excel'); $this->assertEquals($expected, $result); $this->RequestHandler->renderAs($this->Controller, 'json'); $this->assertEquals('CustomJson', $this->Controller->viewClass); }