/** * */ public function setUp() { $this->setApplicationConfig(include __DIR__ . '/../../../config/test/application.config.php'); $oServiceManager = \ApplicationTest\Bootstrap::getServiceManager(); $this->oDao = $oServiceManager->get('DocumentTable'); parent::setUp(); }
/** * */ public function setUp() { $this->setApplicationConfig(include __DIR__ . '/../../../config/test/application.config.php'); $oServiceManager = \ApplicationTest\Bootstrap::getServiceManager(); $this->oEm = $oServiceManager->get('Doctrine\\ORM\\EntityManager'); parent::setUp(); }
public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->setApplicationConfig($this->serviceManager->get('ApplicationConfig')); $this->calc = new Stdlib\Calc(); parent::setUp(); }
/** * */ public function setUp() { $this->setApplicationConfig(include __DIR__ . '/../../../config/test/application.config.php'); $oServiceManager = \ApplicationTest\Bootstrap::getServiceManager(); $COOKIE[DocumentTracker::COOKIE_NAME] = array(); $this->object = $oServiceManager->get('DocumentTracker'); parent::setUp(); }
public function getCategoryService() { if ($this->categoryService) { return $this->categoryService; } $serviceManager = Bootstrap::getServiceManager(); $this->categoryService = $serviceManager->get('categoryfactory'); return $this->categoryService; }
public function testCategories() { $serviceManager = Bootstrap::getServiceManager(); $module = new \MainMenu\Module(); $categories = $module->getTopCategories($serviceManager); $this->assertInternalType('array', $categories); foreach ($categories as $category) { $this->assertInternalType('array', $category['listings']); } }
protected function setUp() { $this->controller = new ConfigurationRestController(); $this->request = new Request(); $this->routeMatch = new RouteMatch(array('controller' => 'rest_configuration')); $this->event = new MvcEvent(); $config = Bootstrap::getServiceManager()->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(Bootstrap::getServiceManager()); }
public function testInvalidAuth() { $this->getRequest()->setMethod('GET'); $this->dispatch('/n/add'); $this->assertResponseStatusCode(302); $auth = Bootstrap::getServiceManager()->get('Whathood\\Model\\AuthenticationService'); $auth->setWhathoodUser(new \Whathood\Entity\WhathoodUser(array('id' => 1))); try { $this->dispatch('/n/add'); //die( $this->getResponse()->getBody() ); $this->fail(); } catch (AuthenticationException $e) { } catch (\FacebookApiException $e) { } $this->assertTrue(true); }
public function setUp() { $serviceManager = Bootstrap::getServiceManager(); $this->setApplicationConfig($serviceManager->get('ApplicationConfig')); $this->controller = new UserController($this->getApplicationServiceLocator()); $this->controller->setTranslator($serviceManager->get('Translator')); $this->routeMatch = new RouteMatch(array('controller' => 'user')); $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); parent::setUp(); }
public function setUp() { $this->setApplicationConfig(include __DIR__ . '/../../../../../config/application.config.php'); parent::setUp(); $serviceManager = Bootstrap::getServiceManager(); $this->controller = new CrudController(); $this->request = new Request(); $this->routeMatch = new RouteMatch(array('controller' => 'index')); $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); $this->controller->em = $this->getMock('Doctrine\\ORM\\EntityManager', array('getRepository', 'getClassMetadata', 'persist', 'flush', 'find'), array(), '', false); }
public function setUp() { $serviceManager = Bootstrap::getServiceManager(); $this->setApplicationConfig($serviceManager->get('ApplicationConfig')); $this->controller = new ListingController($this->getApplicationServiceLocator()); $this->controller->setTranslator($serviceManager->get('Translator')); $this->request = new Request(); $this->routeMatch = new RouteMatch(array('controller' => 'listing')); $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->entityManager = $this->controller->getServiceLocator()->get('entity-manager'); $this->listingEntityClassName = get_class(new Listing()); parent::setUp(); }
private function getConfigurationHandler() { return Bootstrap::getServiceManager()->get('configuration-handler'); }
<?php //http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/getting-started.html#generating-the-database-schema require_once __DIR__ . '/Bootstrap.php'; return \Doctrine\ORM\Tools\Console\ConsoleRunner::createHelperSet(\ApplicationTest\Bootstrap::getServiceManager()->get('entity-manager'));