예제 #1
0
 protected function setUp()
 {
     $serviceManager = Bootstrap::getServiceManager();
     $this->controller = new HomeController();
     $this->request = new Request();
     $this->routeMatch = new RouteMatch(array('controller' => 'home'));
     $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);
 }
예제 #2
0
 protected function setUp()
 {
     $serviceManager = Bootstrap::getServiceManager();
     $this->productTable = $serviceManager->get('Product\\Model\\Product\\ProductTable');
     $this->time = time();
 }