public function setUp() { $this->bootstrap = new \SandboxContact\ZendServiceLocator(); $this->bootstrap->chroot(); $this->setApplicationConfig(include \GearBase\Module::getProjectFolder() . '/config/application.config.php'); parent::setUp(); $this->setServiceLocator($this->bootstrap->getServiceLocator()); }
public function __construct() { $this->chroot(); $zf2ModulePaths[] = realpath(__DIR__ . '/../'); $zf2ModulePaths[] = realpath(__DIR__ . '/../vendor'); $env = getenv('APP_ENV') ?: 'testing'; $applicationConfig = (include \GearBase\Module::getProjectFolder() . '/config/application.config.php'); $config = array('module_listener_options' => array('module_paths' => $zf2ModulePaths, 'config_glob_paths' => array(sprintf(__DIR__ . '/../config/autoload/{,*.}{global,%s,local}.php', $env))), 'modules' => $applicationConfig['modules']); $serviceLocator = new ServiceManager(new ServiceManagerConfig()); $serviceLocator->setService('ApplicationConfig', $config); $serviceLocator->get('ModuleManager')->loadModules(); $this->serviceLocator = $serviceLocator; require_once \GearBase\Module::getProjectFolder() . '/vendor/autoload.php'; }