public function setUp() { parent::setUp(); // All tests are done with local paths to simplify them (no http layer). if ($this->_allowLocalPaths) { $settings = (object) array('local_folders' => (object) array('allow' => '1', 'check_realpath' => '0', 'base_path' => TEST_FILES_DIR)); Zend_Registry::set('oai_pmh_static_repository', $settings); } else { $settings = (object) array('local_folders' => (object) array('allow' => '0', 'check_realpath' => '0', 'base_path' => '/var/path/to/the/folder')); Zend_Registry::set('oai_pmh_static_repository', $settings); } defined('TEST_FILES_WEB') or define('TEST_FILES_WEB', WEB_ROOT . DIRECTORY_SEPARATOR . basename(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'suite' . DIRECTORY_SEPARATOR . '_files'); $pluginHelper = new Omeka_Test_Helper_Plugin(); // ArchiveDocument is a required plugin. $path = PLUGIN_DIR . DIRECTORY_SEPARATOR . 'ArchiveDocument' . DIRECTORY_SEPARATOR . 'ArchiveDocumentPlugin.php'; $this->assertTrue(is_file($path) && filesize($path), __('This plugin requires ArchiveDocument.')); $pluginHelper->setUp('ArchiveDocument'); $pluginHelper->setUp(self::PLUGIN_NAME); // OcrElementSet is an optional plugin, but required for some tests. try { $pluginHelper->setUp('OcrElementSet'); } catch (Omeka_Plugin_Loader_Exception $e) { } // Allow extensions "xml" and "json". $whiteList = get_option(Omeka_Validate_File_Extension::WHITELIST_OPTION) . ',xml,json'; set_option(Omeka_Validate_File_Extension::WHITELIST_OPTION, $whiteList); // Allow media types for "xml" and "json". $whiteList = get_option(Omeka_Validate_File_MimeType::WHITELIST_OPTION) . ',application/xml,text/xml,application/json'; set_option(Omeka_Validate_File_MimeType::WHITELIST_OPTION, $whiteList); }
public function setUp() { parent::setUp(); $pluginHelper = new Omeka_Test_Helper_Plugin(); $pluginHelper->setUp('UserProfiles'); $pluginHelper->setUp('RecordRelations'); $user = $this->_getDefaultUser(); $this->_authenticateUser($user); $this->_setupType(); $this->_setupProfile(); }
public function setUp() { parent::setUp(); $pluginHelper = new Omeka_Test_Helper_Plugin(); $pluginHelper->setUp('RecordRelations'); $this->_createRelation(); }
public function setUp() { parent::setUp(); $pluginHelper = new Omeka_Test_Helper_Plugin(); $pluginHelper->setUp(self::PLUGIN_NAME); define('TEST_FILES_DIR', ARCHIVE_REPERTORY_DIR . '/tests/suite/_files'); // Add constraints if derivatives have been added in the config file. $fileDerivatives = Zend_Registry::get('bootstrap')->getResource('Config')->fileDerivatives; if (!empty($fileDerivatives) && !empty($fileDerivatives->paths)) { foreach ($fileDerivatives->paths->toArray() as $type => $path) { set_option($type . '_constraint', 1); } } // Prepare config and set a test temporary storage in registry. $config = new Omeka_Test_Resource_Config(); $configIni = $config->init(); if (isset($configIni->paths->imagemagick)) { $this->convertDir = $configIni->paths->imagemagick; } else { $this->convertDir = dirname(`which convert`); } $storage = Zend_Registry::get('storage'); $adapter = $storage->getAdapter(); $adapterOptions = $adapter->getOptions(); $this->_storagePath = $adapterOptions['localDir']; // Set default strategy for the creation of derivative files. $this->strategy = new Omeka_File_Derivative_Strategy_ExternalImageMagick(); $this->strategy->setOptions(array('path_to_convert' => $this->convertDir)); $this->creator = new Omeka_File_Derivative_Creator(); $this->creator->setStrategy($this->strategy); Zend_Registry::set('file_derivative_creator', $this->creator); // Create one item on which attach files. $this->item = insert_item(array('public' => true)); set_option('disable_default_file_validation', 1); }
/** * 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(); }
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; }
/** * 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); }
public function setUp() { parent::setUp(); $this->_view = get_view(); $this->_view->addHelperPath(CLEAN_URL_DIR . '/views/helpers', self::PLUGIN_NAME . '_View_Helper_'); $pluginHelper = new Omeka_Test_Helper_Plugin(); $pluginHelper->setUp(self::PLUGIN_NAME); // Add constraints if derivatives have been added in the config file. $fileDerivatives = Zend_Registry::get('bootstrap')->getResource('Config')->fileDerivatives; if (!empty($fileDerivatives) && !empty($fileDerivatives->paths)) { foreach ($fileDerivatives->paths->toArray() as $type => $path) { set_option($type . '_constraint', 1); } } $this->_prepareRecords(); $this->_reloadRoutes(); }
public function setUpPlugin() { $pluginHelper = new Omeka_Test_Helper_Plugin(); $this->_addPluginHooksAndFilters($pluginHelper->pluginBroker, self::PLUGIN_NAME); $pluginHelper->setUp(self::PLUGIN_NAME); }
public function setUpPlugin() { $pluginHelper = new Omeka_Test_Helper_Plugin(); $pluginHelper->setUp('ExhibitBuilder'); }