예제 #1
0
 public function setUp()
 {
     $_SERVER['HTTP_HOST'] = 'cherbouquin';
     $_SERVER['REQUEST_URI'] = 'test_request_uri';
     $this->bootstrap = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
     parent::setUp();
 }
예제 #2
0
 public function setUp()
 {
     $this->bootstrap = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
     $this->_filesForCreate = glob($this->_getCreatePath() . '*.csv');
     $this->_filesForUpdate = glob($this->_getUpdatePath() . '*.csv');
     parent::setUp();
 }
 public function setUp()
 {
     $this->bootstrap = array($this, 'appBootstrap');
     parent::setUp();
     $this->getFrontController()->setParam('bootstrap', $this->_application->getBootstrap());
     // $this->getConnection();
 }
예제 #4
0
 public function setUp()
 {
     $this->bootstrap = array($this, 'appBootstrap');
     parent::setUp();
     $this->userInitials = '';
     $directory = dirname(__FILE__);
     if (strpos($directory, 'clydes') > 1) {
         $this->userInitials = 'cs';
     } elseif (strpos($directory, 'aouie') > 1) {
         $this->userInitials = 'ag';
     } elseif (strpos($directory, 'raph') > 1) {
         $this->userInitials = 'ro';
     } elseif (strpos($directory, 'andrew') > 1) {
         $this->userInitials = 'aa';
     } elseif (strpos($directory, 'charle') > 1) {
         $this->userInitials = 'cm';
     } elseif (strpos($directory, 'patrick') > 1) {
         $this->userInitials = 'pq';
     }
     // As some tests fail on date switches delay if too close to a date switch.
     if (date("H:i:s") > '23:59:50') {
         echo "Sleeping for 10 secs as date is about to switch.\n";
         sleep(10);
     }
 }
예제 #5
0
 public function setUp()
 {
     $this->bootstrap = array($this, 'appBootstrap');
     parent::setUp();
     Zend_Auth::getInstance()->setStorage(new Zend_Auth_Storage_NonPersistent());
     $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
 }
 public function setUp()
 {
     $this->appConfig = WEBSITE_PATH . '../configsGenerated/application.ini';
     $this->bootstrap = new Zend_Application(APPLICATION_PROCEDURE, $this->appConfig);
     ModelFactory::getInstance()->reset();
     parent::setUp();
 }
예제 #7
0
 protected function setUp()
 {
     $this->initDb();
     $this->setUpGcFix();
     $this->resetCaches();
     parent::setUp();
 }
예제 #8
0
 public function setUp()
 {
     $this->bootstrap = array($this, 'appBootstrap');
     $params = array('host' => '127.0.0.1', 'username' => 'lds', 'password' => '123', 'dbname' => 'lds0019');
     $db = Zend_Db::factory('PDO_MYSQL', $params);
     Zend_Registry::set('db', $db);
     parent::setUp();
 }
 public function setUp()
 {
     $this->stopCodeCoverage();
     $this->bootstrap = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
     parent::setUp();
     $this->truncateAllTables(false, []);
     $this->resumeCodeCoverage(false);
 }
 public function setUp()
 {
     $this->bootstrap = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
     $controller = $this->getFrontController();
     $controller->registerPlugin(new Rph_Controller_Plugin_LoginRequired());
     parent::setUp();
     $this->loginAdmin('admin', 'admin');
 }
    public function setUp()
    {
        include APPLICATION_PATH . '/../scripts/load.sqlite.php';

        $application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
        $this->bootstrap = array($application->getBootstrap(), 'bootstrap');
        return parent::setUp();
    }
예제 #12
0
 public function setUp()
 {
     $this->appConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', APPLICATION_ENV);
     $this->doctrine();
     $this->bootstrap = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
     parent::setUp();
     return;
 }
예제 #13
0
	public function setUp ()
	{
		$app = new App ();

		/* the following line is a Zend_Test or PHPUnit feature that
		 * calls $app->bootstrap. @todo: link to documentation. */
		$this->bootstrap = array ($app, 'bootstrap');
		parent::setUp ();
	}
 public function setUp()
 {
     // \Zend_Application: loads the autoloader
     require_once 'Zend/Application.php';
     // Create application, bootstrap, and run
     $application = new \Zend_Application(APPLICATION_ENV, GEMS_ROOT_DIR . '/configs/application.example.ini');
     $this->bootstrap = $application;
     parent::setUp();
 }
예제 #15
0
 public function setUp()
 {
     $this->_logger = Zend_Registry::get('logger');
     if ($this->_databaseUsage) {
         $this->setupDatabase();
     }
     $this->bootstrap = new Zend_Application('testing', APPLICATION_PATH . '/configs/application.ini');
     parent::setUp();
 }
예제 #16
0
 public function setUp()
 {
     $this->bootstrap = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
     parent::setUp();
     $this->_em = Zend_Registry::get('entityManager');
     $tool = new SchemaTool($this->_em);
     $this->_classes = array($this->_em->getClassMetadata('ShortUrl_Model_User'), $this->_em->getClassMetadata('ShortUrl_Model_Group'), $this->_em->getClassMetadata('ShortUrl_Model_Url'));
     $tool->createSchema($this->_classes);
 }
 /**
  * Setup TestCase
  */
 public function setUp()
 {
     $config = APPLICATION_PATH . '/configs/application.yaml';
     $result = new Core_Config_Yaml($config, APPLICATION_ENV);
     $result = $result->toArray();
     $this->bootstrap = new Zend_Application(APPLICATION_ENV, $result);
     parent::setUp();
     $bootstrap = $this->bootstrap->getBootstrap();
     $this->getFrontController()->setParam('bootstrap', $bootstrap);
 }
예제 #18
0
 public function setUp()
 {
     include APPLICATION_PATH . '/../scripts/load.sqlite.php';
     $this->bootstrap = APPLICATION_PATH . '/../tests/application/bootstrap.php';
     $now = new Zend_Date();
     $this->_testEntry = new Postr_Model_Entry();
     $this->_testEntry->setTitle('Test Entry')->setContent('Test entry content.')->setSummary('Test entry summary.')->setUpdated($now)->setPublished($now);
     $this->_entryMapper = new Postr_Model_EntryMapper();
     parent::setUp();
 }
예제 #19
0
 /**
  * this runs at the start of each controller
  * load the default database setup for each class, then make adjustments based on what needs to be changed
  * */
 public function setUp()
 {
     $this->application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
     $this->bootstrap = array($this, 'appBootstrap');
     parent::setUp();
     // CLI doesn't define some global variables, which ends up giving errors on
     // library/Oauth/Request.php and possibly other places too
     $_SERVER['DOCUMENT_ROOT'] = dirname(__FILE__) . '/../applcation';
     $_SERVER['HTTP_HOST'] = 'localhost';
     $this->config = Zend_Registry::get('config');
 }
예제 #20
0
 public function setUp()
 {
     $this->bootstrap = array($this, 'appBootstrap');
     parent::setUp();
     //safety check
     $config = new Zend_Config_Ini(APPLICATION_PATH . "/configs/application.ini", APPLICATION_ENV);
     //My_Logger::log(var_export($config->toArray(), true));
     if ($config->resources->db->params->dbname != 'quiz_db_test') {
         throw new Exception("Incorrect database!!");
     }
     $this->db = Zend_Registry::get("db");
     $this->config = new Zend_Config_Ini(APPLICATION_PATH . "/configs/application.ini", APPLICATION_ENV);
 }
 public function setUpExtensionUnitTest()
 {
     $this->bootstrap = new Zend_Application('extension_unit_testing', ONTOWIKI_ROOT . 'application/config/application.ini');
     parent::setUp();
     if (null !== $this->_extensionName) {
         $extensionManager = OntoWiki::getInstance()->extensionManager;
         if (!$extensionManager->isExtensionActive($this->_extensionName)) {
             Erfurt_Event_Dispatcher::reset();
             $this->markTestSkipped('extension is not active');
         }
     }
     $this->_ac = Erfurt_App::getInstance(false)->getAc();
     $this->_storeAdapter = Erfurt_App::getInstance(false)->getStore()->getBackendAdapter();
 }
예제 #22
0
 public function setUp()
 {
     /**
      * Very bummed out that the following line does not work. Somehow the application created in
      * tests/TestHelper.php is not the same as a new application _created in the exact same
      * way_.
      * It boggles the mind. The only difference is the non-working version is bootstrapped
      * inside TestHelper but if anything I'd think that would be an advantage.
      */
     //$this->application = Zend_Registry::get('application');
     $this->application = new Garp_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
     $this->bootstrap = array($this, 'appBootstrap');
     $this->_helper->setUp($this->_mockData);
     parent::setUp();
 }
예제 #23
0
파일: TestHelper.php 프로젝트: Aeryris/grid
 public function setUp()
 {
     date_default_timezone_set('Europe/Lisbon');
     $this->_temp = realpath(APPLICATION_PATH . '/../tests/_temp/') . '/';
     include_once APPLICATION_PATH . '/models/Model.php';
     // Assign and instantiate in one step:
     $this->bootstrap = new Zend_Application('general', APPLICATION_PATH . '/config.ini');
     $this->controller = Zend_Controller_Front::getInstance();
     $this->db = $this->bootstrap->getBootstrap()->getPluginResource('db')->getDbAdapter();
     $this->controller->setControllerDirectory(APPLICATION_PATH . '/application/controllers');
     $this->controller->setDefaultModule('defualt');
     $this->controller->setDefaultControllerName('site');
     $this->grid = Bvb_Grid::factory('Table');
     $this->grid->setParam('module', 'default');
     $this->grid->setParam('controller', 'site');
     $this->grid->setView(new Zend_View(array()));
     parent::setUp();
 }
 /**
  * Method to initialize Zend_Application for each test.
  */
 public function setUpWithEnv($applicationEnv)
 {
     // Reducing memory footprint by forcing garbage collection runs
     // WARNING: Did not work on CI-System (PHP 5.3.14, PHPnit 3.5.13)
     // gc_collect_cycles();
     $this->closeLogfile();
     $this->closeDatabaseConnection();
     // Resetting singletons or other kinds of persistent objects.
     Opus_Db_TableGateway::clearInstances();
     // FIXME Does it help with the mystery bug?
     Zend_Registry::_unsetInstance();
     // Reset autoloader to fix huge memory/cpu-time leak
     Zend_Loader_Autoloader::resetInstance();
     $autoloader = Zend_Loader_Autoloader::getInstance();
     $autoloader->suppressNotFoundWarnings(false);
     $autoloader->setFallbackAutoloader(true);
     // Clean-up possible artifacts in $_SERVER of previous test.
     unset($_SERVER['REMOTE_ADDR']);
     $this->bootstrap = new Zend_Application($applicationEnv, array("config" => array(APPLICATION_PATH . '/application/configs/application.ini', APPLICATION_PATH . '/tests/tests.ini', APPLICATION_PATH . '/tests/config.ini')));
     // added to ensure that application log messages are written to opus.log when running unit tests
     // if not set messages are written to opus-console.log
     $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.0';
     parent::setUp();
 }
 /**
  * Assigns our bootstrap.
  *
  * @access public
  * @return void
  *
  */
 protected function setUp()
 {
     $this->bootstrap = array($this, 'appBootstrap');
     parent::setUp();
 }
 public function setUp()
 {
     $this->bootstrap = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
     parent::setUp();
 }
예제 #27
0
 protected function setUp()
 {
     parent::setUp();
     // TODO Auto-generated HistoryTest::setUp()
 }
예제 #28
0
 protected function setUp()
 {
     parent::setUp();
     $this->_gb = new Pages_Model_PageEntries();
 }
 public function setUp()
 {
     $this->bootstrap = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
     parent::setUp();
     $this->loginAdmin('*****@*****.**', '123');
 }
예제 #30
0
 /**
  * Prepares the environment before running a test.
  */
 protected function setUp()
 {
     $this->bootstrap = array($this, 'appBootstrap');
     parent::setUp();
     // TODO Auto-generated ArticleControllerTest::setUp()
 }