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;
 }
Exemple #3
0
 /**
  * Load and initialize the database.
  *
  * @return Omeka_Db
  */
 public function init()
 {
     $db = $this->getDb();
     $helper = Omeka_Test_Helper_Db::factory($this);
     if (self::$dropTables) {
         $helper->dropTables();
         self::$dropTables = false;
     }
     if (self::$runInstaller) {
         if (!self::$dropTables) {
             $helper->truncateTables();
         }
         $helper->install();
         self::$runInstaller = false;
     }
     $db->beginTransaction();
     return $db;
 }
 public function tearDown()
 {
     Omeka_Test_Resource_Db::$runInstaller = true;
 }