public function setUp() { $bootstrap = new Omeka_Test_Bootstrap(); $bootstrap->getContainer()->options = array(Theme::PUBLIC_THEME_OPTION => self::THEME, self::THEME_OPTIONS_OPTION => serialize($this->_themeOptions)); $this->dbAdapter = new Zend_Test_DbAdapter(); $this->db = new Omeka_Db($this->dbAdapter, 'omeka_'); $bootstrap->getContainer()->db = $this->db; Zend_Registry::set('bootstrap', $bootstrap); }
public function setUp() { // Configure the options so that get_theme_option() can automatically retrieve // options for the given theme. $bootstrap = new Omeka_Test_Bootstrap(); $bootstrap->getContainer()->options = array(Theme::PUBLIC_THEME_OPTION => self::THEME_NAME, 'theme_' . self::THEME_NAME . '_options' => serialize($this->_themeOptions)); Zend_Registry::set('bootstrap', $bootstrap); }
public function setUp() { $this->view = new Omeka_View(); Zend_Registry::set('view', $this->view); $bootstrap = new Omeka_Test_Bootstrap(); $bootstrap->getContainer()->db = $this->getMock('Omeka_Db', null, array(null)); Zend_Registry::set('bootstrap', $bootstrap); }
public function setUp() { $this->dbAdapter = new Zend_Test_DbAdapter(); $this->db = new Omeka_Db($this->dbAdapter, 'omeka_'); $bootstrap = new Omeka_Test_Bootstrap(); $bootstrap->getContainer()->db = $this->db; Zend_Registry::set('bootstrap', $bootstrap); $this->table = new Table_Item('Item', $this->db); }
public function setUp() { // Link a mock collections table to a mock database. $this->db = $this->getMock('Omeka_Db', array(), array(), '', false); $this->collectionTable = $this->getMock('Table_Collection', array(), array(), '', false); $this->db->expects($this->any())->method('getTable')->with('Collection')->will($this->returnValue($this->collectionTable)); $bootstrap = new Omeka_Test_Bootstrap(); $bootstrap->getContainer()->db = $this->db; Zend_Registry::set('bootstrap', $bootstrap); }
public function setUp() { $this->dbAdapter = new Zend_Test_DbAdapter(); $this->db = new Omeka_Db($this->dbAdapter); $this->timeline = new NeatlineTimeTimeline($this->db); $this->user = new User($this->db); $bootstrap = new Omeka_Test_Bootstrap(); $bootstrap->getContainer()->db = $this->db; Zend_Registry::set('bootstrap', $bootstrap); }
public function setUp() { // Set a fake Omeka_Db on Omeka_Context to allow us to instantiate // Omeka_Records. $dbAdapter = new Zend_Test_DbAdapter(); $db = new Omeka_Db($dbAdapter, 'omeka_'); $bootstrap = new Omeka_Test_Bootstrap(); $bootstrap->getContainer()->db = $db; Zend_Registry::set('bootstrap', $bootstrap); }
public function testGetSetPluginBroker() { $record = new DummyRecord($this->db); $this->assertNull($record->getPluginBroker()); $bootstrap = new Omeka_Test_Bootstrap(); $bootstrap->getContainer()->pluginbroker = $this->pluginBroker; Zend_Registry::set('bootstrap', $bootstrap); $this->assertSame($this->pluginBroker, $record->getPluginBroker()); $mockPluginBroker = $this->getMock('Omeka_Plugin_Broker', array(), array(), '', false); $record->setPluginBroker($mockPluginBroker); $this->assertSame($mockPluginBroker, $record->getPluginBroker()); }