Exemple #1
0
 public function setup()
 {
     parent::setup();
     $storage = $this->getStorage();
     $this->service1 = new Lock\LockService(['storage' => $storage]);
     $this->service2 = new Lock\LockService(['storage' => $storage]);
 }
 public function setup()
 {
     parent::setup();
     $pathDir = getcwd() . "/";
     $config = (include $pathDir . 'config/application.config.php');
     $this->serviceManager = new ServiceManager(new ServiceManagerConfig(isset($config['service_manager']) ? $config['service_manager'] : array()));
     $this->serviceManager->setService('ApplicationConfig', $config);
     $this->serviceManager->setFactory('ServiceListener', 'Zend\\Mvc\\Service\\ServiceListenerFactory');
     $moduleManager = $this->serviceManager->get('ModuleManager');
     $moduleManager->loadModules();
     $this->routes = array();
     $this->modules = $moduleManager->getModules();
     foreach ($this->filterModules() as $m) {
         $moduleConfig = (include $pathDir . 'module/' . ucfirst($m) . '/config/module.config.php');
         if (isset($moduleConfig['router'])) {
             foreach ($moduleConfig['router']['routes'] as $key => $name) {
                 $this->routes[$key] = $name;
             }
         }
     }
     $this->serviceManager->setAllowOverride(true);
     $this->application = $this->serviceManager->get('Application');
     $this->event = new MvcEvent();
     $this->event->setTarget($this->application);
     $this->event->setApplication($this->application)->setRequest($this->application->getRequest())->setResponse($this->application->getResponse())->setRouter($this->serviceManager->get('Router'));
     $this->em = $this->serviceManager->get('Doctrine\\ORM\\EntityManager');
     foreach ($this->filterModules() as $m) {
         $this->createDatabase($m);
     }
 }
 public function setup()
 {
     parent::setup();
     $this->command = $this->getMockBuilder('PHPCI\\Command\\CreateAdminCommand')->setConstructorArgs([$this->getMock('PHPCI\\Store\\UserStore')])->setMethods(['reloadConfig'])->getMock();
     $this->dialog = $this->getMockBuilder('Symfony\\Component\\Console\\Helper\\DialogHelper')->setMethods(['ask', 'askAndValidate', 'askHiddenResponse'])->getMock();
     $this->application = new Application();
 }
 public function setup()
 {
     parent::setup();
     $config = (include 'config/application.config.php');
     $config['module_listener_options']['config_static_paths'] = array(getcwd() . '/config/test.config.php');
     if (file_exists(__DIR__ . '/config/test.config.php')) {
         $moduleConfig = (include __DIR__ . '/config/test.config.php');
         array_unshift($config['module_listener_options']['config_static_paths'], $moduleConfig);
     }
     $this->serviceManager = new ServiceManager(new ServiceManagerConfig(isset($config['service_manager']) ? $config['service_manager'] : array()));
     $this->serviceManager->setService('ApplicationConfig', $config);
     $this->serviceManager->setFactory('ServiceListener', 'Zend\\Mvc\\Service\\ServiceListenerFactory');
     $moduleManager = $this->serviceManager->get('ModuleManager');
     $moduleManager->loadModules();
     $this->routes = array();
     foreach ($moduleManager->getModules() as $m) {
         $moduleConfig = (include __DIR__ . '/../../../../' . ucfirst($m) . '/config/module.config.php');
         if (isset($moduleConfig['router'])) {
             foreach ($moduleConfig['router']['routes'] as $key => $name) {
                 $this->routes[$key] = $name;
             }
         }
     }
     $this->serviceManager->setAllowOverride(true);
     $this->application = $this->serviceManager->get('Application');
     $this->event = new MvcEvent();
     $this->event->setTarget($this->application);
     $this->event->setApplication($this->application)->setRequest($this->application->getRequest())->setResponse($this->application->getResponse())->setRouter($this->serviceManager->get('Router'));
     $this->createDatabase();
 }
 public function setUp()
 {
     parent::setup();
     $this->id = 'xxxxxx';
     $this->label = 'my_label';
     $this->value = 100;
     $this->conversion = new Conversion($this->id, $this->label, $this->value);
 }
 public function setUp()
 {
     parent::setup();
     // Create a new client, set it to use batch mode, but do not authenticate
     $this->client = new Google_Client();
     $this->client->setApplicationName("Google Apps Groups Controller Test");
     $this->client->setUseBatch(true);
 }
 public function setUp()
 {
     parent::setup();
     $this->category = 'Test category';
     $this->action = 'Test action';
     $this->label = 'Test label';
     $this->value = 'Test value';
     $this->event = new Event($this->category, $this->action);
 }
Exemple #8
0
 public function setup()
 {
     $em = $this->getEntityManager();
     $tool = new SchemaTool($em);
     //busca a informação de todas as entidades
     $classes = $em->getMetadataFactory()->getAllMetadata();
     // cria a base de dados para os testes
     $tool->createSchema($classes);
     parent::setup();
 }
Exemple #9
0
 public function setup()
 {
     parent::setup();
     $this->_view = Solar::factory('Solar_View');
     $this->_name = substr(get_class($this), 18, -4);
     $this->_name[0] = strtolower($this->_name[0]);
     // retain and reset the request environment
     $this->_request = Solar_Registry::get('request');
     $this->_request->reset();
 }
 public function setUp()
 {
     parent::setup();
     $this->validApiUserName = '******';
     $this->validApiPassword = '******';
     $this->validBaseUrl = 'https://valid.base.url/';
     $this->validModule = 'validmodule';
     $this->validAction = 'validaction';
     $this->validFormat = SendGridWebApiAbstract::SENDGRID_RESPONSE_FORMAT_JSON;
     $this->validHttpResponse = new Response(200);
 }
 public function setup()
 {
     parent::setup();
     $projectMock = $this->getMock('PHPCI\\Model\\Project');
     $projectStoreMock = $this->getMockBuilder('PHPCI\\Store\\ProjectStore')->getMock();
     $projectStoreMock->method('getById')->will($this->returnValueMap(array(array(1, 'read', $projectMock), array(2, 'read', null))));
     $buildServiceMock = $this->getMockBuilder('PHPCI\\Service\\BuildService')->disableOriginalConstructor()->getMock();
     $buildServiceMock->method('createBuild')->withConsecutive(array($projectMock, null, null, null, null, null), array($projectMock, '92c8c6e', null, null, null, null), array($projectMock, null, 'master', null, null, null));
     $this->command = $this->getMockBuilder('PHPCI\\Command\\CreateBuildCommand')->setConstructorArgs(array($projectStoreMock, $buildServiceMock))->setMethods(array('reloadConfig'))->getMock();
     $this->application = new Application();
 }
Exemple #12
0
 /**
  * Faz o setup dos testes. Executado antes de cada teste
  * @return void
  */
 public function setup()
 {
     $env = getenv('ENV');
     //o jenkins tem configurações especiais
     if (!$env || $env != 'jenkins') {
         putenv("ENV=testing");
         $env = 'testing';
     }
     putenv('PROJECT_ROOT=' . __DIR__ . '/../../../../../');
     parent::setup();
     //arquivo de configuração da aplicação
     $config = (include __DIR__ . '/../../../../../config/tests.config.php');
     $config['module_listener_options']['config_static_paths'] = array();
     //cria um novo ServiceManager
     $this->serviceManager = new ServiceManager(new ServiceManagerConfig(isset($config['service_manager']) ? $config['service_manager'] : array()));
     //configura os serviços básicos no ServiceManager
     $this->serviceManager->setService('ApplicationConfig', $config);
     $this->serviceManager->setFactory('ServiceListener', 'Zend\\Mvc\\Service\\ServiceListenerFactory');
     //verifica se os módulos possuem rotas configuradas e carrega elas para serem usadas pelo ControllerTestCase
     $moduleManager = $this->serviceManager->get('ModuleManager');
     $moduleManager->loadModules();
     $this->routes = array();
     $testConfig = false;
     //carrega as rotas dos módulos
     foreach ($moduleManager->getLoadedModules() as $m) {
         $moduleConfig = $m->getConfig();
         $this->getModuleRoutes($moduleConfig);
         $moduleName = explode('\\', get_class($m));
         $moduleName = $moduleName[0];
         //verifica se existe um arquivo de configuração específico no módulo para testes
         if (file_exists(getcwd() . '/module/' . ucfirst($moduleName) . '/config/test.config.php')) {
             $testConfig = (include getcwd() . '/module/' . ucfirst($moduleName) . '/config/test.config.php');
             array_unshift($config['module_listener_options']['config_static_paths'], $testConfig[$env]);
         }
     }
     if (!$testConfig) {
         $config['module_listener_options']['config_static_paths'] = array(getcwd() . '/config/tests.config.php');
     }
     $this->config = (include $config['module_listener_options']['config_static_paths'][0]);
     $this->serviceManager->setAllowOverride(true);
     //instancia a aplicação e configura os eventos e rotas
     $this->application = $this->serviceManager->get('Application');
     $this->event = new MvcEvent();
     $this->event->setTarget($this->application);
     $this->event->setApplication($this->application)->setRequest($this->application->getRequest())->setResponse($this->application->getResponse())->setRouter($this->serviceManager->get('Router'));
     $this->entityManager = $this->getEntityManager();
     $this->dropDatabase();
     $this->createDatabase();
 }
 public function setup()
 {
     parent::setup();
     // where is our development maven repository?
     $this->_projectDir = realpath(__DIR__ . "/../../../..");
     $name = $this->getName();
     $prefix = "testGradleWrapper_";
     if (substr($name, 0, strlen($prefix)) == $prefix) {
         $name = substr($name, strlen($prefix));
         $p = strpos($name, "_AndroidPlugin_");
         $wrapperVersion = substr($name, 0, $p);
         $wrapperVersion = str_replace("_", ".", $wrapperVersion);
         $pluginVersion = substr($name, $p + strlen("_AndroidPlugin_"));
         $pluginVersion = str_replace("_", ".", $pluginVersion);
         $this->tryGradle($wrapperVersion, $pluginVersion);
     }
 }
 public function setup()
 {
     parent::setup();
     $this->analyzer = new Analyzer(new Parser());
     $this->fileNameWithPath = __DIR__ . '/../Fixtures/summary.xml';
 }
Exemple #15
0
 public function setUp()
 {
     parent::setup();
     $this->marker = new Marker();
 }
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $this->object = new \Yaf\Application(__DIR__ . "/../../../application/configs/application.ini");
     parent::setup();
     // new AuthController;
 }
 public function setUp()
 {
     parent::setup();
     $this->loader = new ConfigLoader();
 }
 public function setUp()
 {
     parent::setup();
     $this->map = new StaticMap();
 }
Exemple #19
0
 public function setUp()
 {
     parent::setup();
     $request = m::mock('Damienpirsy\\Teamwork\\Contracts\\RequestableInterface');
     $this->object = new ObjectStub($request);
 }
 public function setup()
 {
     parent::setup();
     $this->mpdf = new mPDF();
 }
 public function setUp()
 {
     parent::setup();
 }
Exemple #22
0
 /**
  * @before
  */
 function setup()
 {
     parent::setup();
     $this->bh = new BH();
     $this->ctx = new Context($this->bh);
 }
 public function setUp()
 {
     parent::setup();
     $this->methodViolationFilter = new MethodViolationFilter($this->filterList);
 }
 public function setup()
 {
     parent::setup();
     $this->createDatabase();
 }
 protected function setUp()
 {
     parent::setup();
     $this->testedInterpolator = new BuildInterpolator();
 }
 public function setup()
 {
     parent::setup();
     $this->api = new Api($this->getSession(), $this->getLogger());
 }
 protected function setUp()
 {
     parent::setup();
     $this->semanticDataFactory = UtilityFactory::getInstance()->newSemanticDataFactory();
 }
 protected function setup()
 {
     parent::setup();
     $_SERVER['REQUEST_URI'] = '/';
     include "./main.php";
 }
 public function setUp()
 {
     parent::setup();
     $this->transaction = new Transaction();
 }
Exemple #30
0
 public function setup()
 {
     parent::setup();
     $this->_view = Solar::factory('Solar_View');
 }