Inheritance: extends Zend\Mvc\Controller\Plugin\AbstractPlugin
コード例 #1
0
ファイル: ForwardTest.php プロジェクト: rajanlamic/IntTest
 public function testPluginWithoutEventAwareControllerRaisesDomainException()
 {
     $controller = new UneventfulController();
     $plugin = new ForwardPlugin($this->controllers);
     $plugin->setController($controller);
     $this->setExpectedException('Zend\\Mvc\\Exception\\DomainException', 'InjectApplicationEventInterface');
     $plugin->dispatch('forward');
 }
コード例 #2
0
 public function testPluginWithoutLocatorAwareControllerRaisesDomainException()
 {
     $controller = new UnlocatableEventfulController();
     $controller->setEvent($this->controller->getEvent());
     $plugin     = new ForwardPlugin();
     $plugin->setController($controller);
     $this->setExpectedException('Zend\Mvc\Exception\DomainException', 'implements ServiceLocatorAwareInterface');
     $plugin->dispatch('forward');
 }
コード例 #3
0
ファイル: ForwardTest.php プロジェクト: noopable/zf2
 /**
  * compatibility with ModuleRouteListener
  *
  * @see Zend\Mvc\ModuleRouteListener
  */
 public function testShorNamedController()
 {
     $shortNamedController = 'forward-fq';
     $origCtlKey = ModuleRouteListener::ORIGINAL_CONTROLLER;
     $params = array(ModuleRouteListener::MODULE_NAMESPACE => 'ZendTest\\Mvc\\Controller\\TestAsset', 'action' => 'test', 'param1' => 'foo');
     $result = $this->plugin->dispatch($shortNamedController, $params);
     $this->assertInternalType('array', $result);
     $this->assertArrayHasKey('content', $result);
     $this->assertEquals('ZendTest\\Mvc\\Controller\\TestAsset\\ForwardFqController::testAction', $result['content']);
     $this->assertArrayHasKey('params', $result);
     $this->assertArrayHasKey($origCtlKey, $result['params']);
     $this->assertEquals($shortNamedController, $result['params'][$origCtlKey]);
 }