Example #1
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();
 }
 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();
 }
 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);
     }
 }
Example #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 tearDown()
 {
     /* @var $dbAdapter Zend_Db_Adapter_Abstract */
     $dbAdapter = Zend_Registry::get('db');
     $dbAdapter->closeConnection();
     parent::tearDown();
 }
 protected function tearDown()
 {
     $this->resetRequest();
     $this->resetResponse();
     $this->_logout();
     parent::tearDown();
 }
 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->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;
 }
Example #10
0
 public function __construct($name = NULL, array $data = array(), $dataName = '')
 {
     if (null == $this->bootstrap) {
         // Assign and instantiate in one step:
         $this->bootstrap = new Centurion_Application(APPLICATION_ENV, Centurion_Config_Directory::loadConfig(APPLICATION_PATH . '/configs/', APPLICATION_ENV, true));
     }
     parent::__construct($name, $data, $dataName);
 }
Example #11
0
 /**
  * Добавлено закрытие mysql-соединения при сбросе
  *
  * @return void
  */
 public function reset()
 {
     parent::reset();
     $db = Zend_Db_Table_Abstract::getDefaultAdapter();
     if ($db instanceof Zend_Db_Adapter_Abstract) {
         $db->closeConnection();
     }
 }
Example #12
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()
    {
        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();
    }
 public function __construct($name = NULL, array $data = array(), $dataName = '')
 {
     if (null == $this->bootstrap) {
         // Assign and instantiate in one step:
         $this->bootstrap = new Centurion_Application('testing', APPLICATION_PATH . '/configs/');
     }
     parent::__construct($name, $data, $dataName);
 }
 public function dispatch($url = null)
 {
     // removing this helper solves issues with multiple redirects in one test
     // a fresh instance of helper is registered anyway
     Zend_Controller_Action_HelperBroker::removeHelper('redirector');
     //         Zend_Controller_Action_HelperBroker::removeHelper('flashMessenger');
     parent::dispatch($url);
 }
 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');
 }
Example #17
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();
 }
Example #19
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);
 }
Example #20
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();
 }
 protected function tearDown()
 {
     // restore config
     if (static::BACKUP_CONFIG) {
         ConfigHelper::restoreConfig();
     }
     $this->fixMemoryUsage();
     parent::tearDown();
     $this->tearDownGcFix();
 }
 protected function tearDown()
 {
     if ($this->databaseTester) {
         $this->databaseTester->onTearDown();
         //default null operation - nothing to
         /**
          * Destroy the tester after the test is run to keep DB connections
          * from piling up.
          */
         $this->databaseTester = null;
     }
     parent::tearDown();
 }
 /**
  * Overwritten to toss exceptions in your face, so developers don't have to inspect the
  * HTML response to see what went wrong.
  * We'll skip Zend_Controller_Action_Exceptions though, because they actually provide semantic
  * meaning to response. For instance, you can use them to adjust the HTTP status code, which is
  * actually a valid response to these exception.
  * This method should throw only unexpected exceptions that need fixing right away.
  */
 public function dispatch($url = null)
 {
     $response = parent::dispatch($url);
     if (!$this->getResponse()->isException()) {
         return $response;
     }
     foreach ($this->getResponse()->getException() as $exp) {
         if (!$exp instanceof Zend_Controller_Action_Exception) {
             throw $exp;
         }
     }
     return $response;
 }
Example #24
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();
 }
Example #26
0
 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();
 }
 /**
  * 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();
 }
Example #29
0
 /**
  * Cleans up the environment after running a test.
  */
 protected function tearDown()
 {
     // TODO Auto-generated HistoryTest::tearDown()
     parent::tearDown();
 }
 protected function tearDown()
 {
     $this->_gb = null;
     parent::tearDown();
 }