コード例 #1
0
ファイル: HomeControllerTest.php プロジェクト: RRcom/Product
 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
ファイル: ProductTableTest.php プロジェクト: RRcom/Product
 protected function setUp()
 {
     $serviceManager = Bootstrap::getServiceManager();
     $this->productTable = $serviceManager->get('Product\\Model\\Product\\ProductTable');
     $this->time = time();
 }