예제 #1
0
 public function setUp()
 {
     $serviceManager = Bootstrap::getServiceManager();
     $this->setApplicationConfig($serviceManager->get('ApplicationConfig'));
     $this->controller = new UserController($this->getApplicationServiceLocator());
     $this->controller->setTranslator($serviceManager->get('Translator'));
     $this->routeMatch = new RouteMatch(array('controller' => 'user'));
     $this->event = new MvcEvent();
     $config = $serviceManager->get('config');
     $routerConfig = isset($config['router']) ? $config['router'] : array();
     $router = HttpRouter::factory($routerConfig);
     $this->event->setRouter($router);
     $this->event->setRouteMatch($this->routeMatch);
     $this->controller->setEvent($this->event);
     $this->controller->setServiceLocator($serviceManager);
     parent::setUp();
 }