Exemplo n.º 1
0
 protected function setUp()
 {
     $serviceManagerGrabber = new ServiceManagerGrabber();
     $this->serviceManager = $serviceManagerGrabber->getServiceManager();
     $this->serviceManager->setAllowOverride(true);
     $this->serviceManager->setService('doctrine.entitymanager.orm_default', $this->getEntityManagerMock());
     $config = $this->serviceManager->get('Config');
     $this->request = new PhpEnviromentRequest();
     $this->router = HttpRouter::factory(isset($config['router']) ? $config['router'] : array());
     $this->routeMatch = new RouteMatch(array('controller' => 'index'));
     $this->routeMatch->setParam('lang', 'it');
     $this->event = new MvcEvent();
     $this->event->setRouter($this->router);
     $this->event->setRouteMatch($this->routeMatch);
 }
Exemplo n.º 2
0
<?php

use ModelModuleTest\ServiceManagerGrabber;
error_reporting(E_ALL | E_STRICT);
$cwd = __DIR__;
chdir(dirname(__DIR__));
// Assume we use composer
$loader = (require_once './vendor/autoload.php');
$loader->add("AdminTest\\", $cwd);
$loader->add("ApiWebServiceTest\\", $cwd);
$loader->add("ApplicationTest\\", $cwd);
$loader->add("AuthTest\\", $cwd);
$loader->add("ModelModuleTest\\", $cwd);
$loader->add("ServiceLocatorFactoryTest\\", $cwd);
$loader->register();
ServiceManagerGrabber::setServiceConfig(require_once './config/application.config.php');
ob_start();