/** * @group ZF-2693 */ public function testForcingCamelCasedActionsNotRequestedWithWordSeparatorsShouldRaiseNotices() { $this->_dispatcher->setParam('useCaseSensitiveActions', true); $request = new Request\Http(); $request->setModuleName('admin'); $request->setControllerName('foo-bar'); $request->setActionName('bazBat'); $this->assertTrue($this->_dispatcher->isDispatchable($request), var_export($this->_dispatcher->getControllerDirectory(), 1)); $response = new Response\Cli(); set_error_handler(array($this, 'handleErrors')); try { $this->_dispatcher->dispatch($request, $response); $body = $this->_dispatcher->getResponse()->getBody(); restore_error_handler(); $this->assertTrue(isset($this->error)); $this->assertContains('deprecated', $this->error); } catch (Controller\Exception $e) { restore_error_handler(); $this->fail('camelCased actions should succeed when forced'); } }
/** * @group ZF-2910 */ public function testShouldAllowRetrievingCurrentModuleDirectory() { $this->testAddModuleDirectory(); $request = new Request\Http(); $request->setModuleName('bar'); $this->_controller->setRequest($request); $dir = $this->_controller->getModuleDirectory(); $this->assertContains('modules' . DIRECTORY_SEPARATOR . 'bar', $dir); $this->assertNotContains('controllers', $dir); }
public function testHelperPullsResponseFromFrontControllerWithNoRegisteredActionController() { $helper = HelperBroker::getStaticHelper('viewRenderer'); $this->assertNull($helper->getActionController()); $aRequest = new Request(); $aRequest->setModuleName('default')->setControllerName('zend_controller_action_helper-broker')->setActionName('index'); $aResponse = new Response(); $fRequest = new Request(); $fRequest->setModuleName('foo')->setControllerName('foo-bar')->setActionName('baz'); $fResponse = new Response(); $this->front->setRequest($fRequest)->setResponse($fResponse); $hRequest = $helper->getRequest(); $this->assertNotSame($hRequest, $aRequest); $this->assertSame($hRequest, $fRequest); $hResponse = $helper->getResponse(); $this->assertNotSame($hResponse, $aResponse); $this->assertSame($hResponse, $fResponse); }