/**
  * Spin up the plugins and prepare the database.
  *
  * @return void.
  */
 public function setUpPlugin()
 {
     parent::setUp();
     $this->user = $this->db->getTable('User')->find(1);
     $this->_authenticateUser($this->user);
     $this->servicesTable = $this->db->getTable('NeatlineMapsService');
     $this->serversTable = $this->db->getTable('NeatlineMapsServer');
     // Set up Neatline WMS.
     $plugin_broker = get_plugin_broker();
     $this->_addHooksAndFilters($plugin_broker, 'NeatlineMaps');
     $plugin_helper = new Omeka_Test_Helper_Plugin();
     $plugin_helper->setUp('NeatlineMaps');
     $this->_dbHelper = Omeka_Test_Helper_Db::factory($this->core);
 }
Ejemplo n.º 2
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;
 }
 /**
  * Set ups up for each test.
  *
  * @return void
  * @author Eric Rochester <*****@*****.**>
  **/
 public function setUp()
 {
     parent::setUp();
     $this->_todel = array();
     $this->user = $this->db->getTable('user')->find(1);
     $this->_authenticateUser($this->user);
     $this->phelper = new Omeka_Test_Helper_Plugin();
     $this->phelper->setUp('NeatlineFeatures');
     $this->_dbHelper = Omeka_Test_Helper_Db::factory($this->application);
     // Retrieve the element for some DC fields.
     $el_table = get_db()->getTable('Element');
     $this->_title = $el_table->findByElementSetNameAndElementName('Dublin Core', 'Title');
     $this->_subject = $el_table->findByElementSetNameAndElementName('Dublin Core', 'Subject');
     $this->_coverage = $el_table->findByElementSetNameAndElementName('Dublin Core', 'Coverage');
     $this->_cutil = new NeatlineFeatures_Utils_View();
     $this->_cutil->setEditOptions(null, $this->_coverage, "", "Elements[38][0]", 0);
     $this->_item = new Item();
     $this->_item->save();
     $this->toDelete($this->_item);
     $t1 = $this->addElementText($this->_item, $this->_title, '<b>A Title</b>', 1);
     $t2 = $this->addElementText($this->_item, $this->_subject, 'Subject');
     $this->toDelete($t1);
     $this->toDelete($t2);
     $this->_item->save();
 }