public function setUp()
 {
     parent::setUp();
     // Authenticate and set the current user
     $this->user = $this->db->getTable('User')->find(1);
     $this->_authenticateUser($this->user);
     $pluginHelper = new Omeka_Test_Helper_Plugin();
     $pluginHelper->setUp(self::PLUGIN_NAME);
     Omeka_Test_Resource_Db::$runInstaller = true;
 }
 /**
  * Spin up the plugins and prepare the database.
  *
  * @return void.
  */
 public function setUp()
 {
     parent::setUp();
     $this->user = $this->db->getTable('User')->find(1);
     $this->_authenticateUser($this->user);
     // Set up Neatline Time.
     $plugin_helper = new Omeka_Test_Helper_Plugin();
     $plugin_helper->setUp('NeatlineTime');
     Omeka_Test_Resource_Db::$runInstaller = true;
 }
Ejemplo n.º 3
0
 public static function setDbAdapter(Zend_Db_Adapter_Abstract $dbAdapter)
 {
     self::$_cachedAdapter = $dbAdapter;
 }
 public function tearDown()
 {
     Omeka_Test_Resource_Db::$runInstaller = true;
 }
Ejemplo n.º 5
0
 /**
  * Reset objects that carry global state between test runs.
  *
  * @return void
  */
 public function tearDown()
 {
     // This fixes a "too many open files" error caused by hanging references
     // to the logger object somewhere in the code (could be anywhere).
     // Since log files are only closed in log writer shutdown (only in
     // destructor), this hanging reference keeps another file open with each
     // test run.
     if ($this->logger instanceof Zend_Log) {
         $this->logger->__destruct();
     }
     if ($this->db instanceof Omeka_Db) {
         Omeka_Test_Resource_Db::setDbAdapter($this->db->getAdapter());
         $this->db->rollBack();
     }
     Zend_Registry::_unsetInstance();
     unset($this->bootstrap);
     unset($this->application);
     parent::tearDown();
 }