コード例 #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
ファイル: IndexControllerTest.php プロジェクト: OnekO/csvdemo
 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();
 }
コード例 #3
0
 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
ファイル: ControllerTestCase.php プロジェクト: kminkov/Blog
 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';
 }
コード例 #6
0
 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
ファイル: ControllerTestCase.php プロジェクト: sandin/iMemo
 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();
 }
コード例 #9
0
 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);
 }
コード例 #10
0
 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
ファイル: OpcTest.php プロジェクト: rajatkhanduja/opc
	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 ();
	}
コード例 #14
0
 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
ファイル: ControllerTestCase.php プロジェクト: dmelo/dzend
 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
ファイル: UrlDBTest.php プロジェクト: heiglandreas/ShortURL
 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);
 }
コード例 #17
0
 /**
  * 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);
 }
コード例 #21
0
 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();
 }
コード例 #24
0
 /**
  * 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();
 }
コード例 #25
0
 /**
  * Assigns our bootstrap.
  *
  * @access public
  * @return void
  *
  */
 protected function setUp()
 {
     $this->bootstrap = array($this, 'appBootstrap');
     parent::setUp();
 }
コード例 #26
0
 public function setUp()
 {
     $this->bootstrap = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
     parent::setUp();
 }
コード例 #27
0
ファイル: HistoryTest.php プロジェクト: laiello/mock-project
 protected function setUp()
 {
     parent::setUp();
     // TODO Auto-generated HistoryTest::setUp()
 }
コード例 #28
0
 protected function setUp()
 {
     parent::setUp();
     $this->_gb = new Pages_Model_PageEntries();
 }
コード例 #29
0
 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()
 }