public function setUp() { $this->initDatabaseAdapter(); $this->sm = Bootstrap::getServiceManager(); $this->sm->setAllowOverride(true); $this->sm->setService('Techtree\\Entity\\ColonyResearch', new \Techtree\Entity\ColonyResearch()); $this->sm->setService('Zend\\Db\\Adapter\\Adapter', $this->dbAdapter); }
/** * * @param ServiceLocatorInterface $serviceLocator * @return \Techtree\Service\BuildingService */ public function setUp() { $this->sm = Bootstrap::getServiceManager(); $this->sm->setAllowOverride(true); $servicesToMock = array('Core\\Service\\Tick' => 'Core\\Service\\Tick', 'logger' => 'Zend\\Log\\Logger', 'Techtree\\Table\\BuildingTable' => 'Techtree\\Table\\BuildingTable', 'Techtree\\Table\\BuildingCostTable' => 'Techtree\\Table\\BuildingCostTable', 'Techtree\\Table\\ColonyBuildingTable' => 'Techtree\\Table\\ColonyBuildingTable', 'Techtree\\Table\\ColonyResearchTable' => 'Techtree\\Table\\ColonyResearchTable', 'Techtree\\Table\\ColonyShipTable' => 'Techtree\\Table\\ColonyShipTable', 'Techtree\\Table\\ColonyPersonellTable' => 'Techtree\\Table\\ColonyPersonellTable', 'Techtree\\Table\\ColonyTable' => 'Techtree\\Table\\ColonyTable', 'Techtree\\Table\\ResearchTable' => 'Techtree\\Table\\ResearchTable', 'Techtree\\Table\\ShipTable' => 'Techtree\\Table\\ShipTable', 'Techtree\\Table\\PersonellTable' => 'Techtree\\Table\\PersonellTable', 'Resources\\Service\\ResourcesService' => 'Resources\\Service\\ResourcesService'); foreach ($servicesToMock as $key => $serviceName) { $this->sm->setService($key, $this->getMockBuilder($serviceName)->disableOriginalConstructor()->getMock()); } }
public function setUp() { $this->sm = Bootstrap::getServiceManager(); $this->sm->setAllowOverride(true); $this->sm->setService('Core\\Service\\Tick', $this->getMockBuilder('Core\\Service\\Tick')->disableOriginalConstructor()->getMock()); $this->sm->setService('logger', $this->getMockBuilder('Zend\\Log\\Logger')->disableOriginalConstructor()->getMock()); $this->sm->setService('Techtree\\Table\\ResearchTable', $this->getMockBuilder('Techtree\\Table\\ResearchTable')->disableOriginalConstructor()->getMock()); $this->sm->setService('Techtree\\Table\\ResearchCostTable', $this->getMockBuilder('Techtree\\Table\\ResearchCostTable')->disableOriginalConstructor()->getMock()); $this->sm->setService('Techtree\\Table\\ColonyResearchTable', $this->getMockBuilder('Techtree\\Table\\ColonyResearchTable')->disableOriginalConstructor()->getMock()); $this->sm->setService('Resources\\Service\\ResourcesService', $this->getMockBuilder('Resources\\Service\\ResourcesService')->disableOriginalConstructor()->getMock()); $this->sm->setService('Galaxy\\Service\\Gateway', $this->getMockBuilder('Galaxy\\Service\\Gateway')->disableOriginalConstructor()->getMock()); }
public function setUp() { $this->sm = Bootstrap::getServiceManager(); #$this->sm->setAllowOverride(true); }
$zf2Path = $vendorPath . '/ZF2/library'; } elseif (is_dir($vendorPath . '/zendframework/zendframework/library')) { $zf2Path = $vendorPath . '/zendframework/zendframework/library'; } } if (!$zf2Path) { throw new RuntimeException('Unable to load ZF2. Run `php composer.phar install` or' . ' define a ZF2_PATH environment variable.'); } if (file_exists($vendorPath . '/autoload.php')) { include $vendorPath . '/autoload.php'; } include $zf2Path . '/Zend/Loader/AutoloaderFactory.php'; AutoloaderFactory::factory(array('Zend\\Loader\\StandardAutoloader' => array('autoregister_zf' => true, 'namespaces' => array(__NAMESPACE__ => __DIR__ . '/' . __NAMESPACE__)))); } protected static function findParentPath($path) { $dir = __DIR__; $previousDir = '.'; while (!is_dir($dir . '/' . $path)) { $dir = dirname($dir); if ($previousDir === $dir) { return false; } $previousDir = $dir; } return $dir . '/' . $path; } } Bootstrap::init(); Bootstrap::chroot();