Exemple #1
0
 public function testInsertsOptions()
 {
     $task = new Installer_Task_Options();
     $task->setOptions(array('administrator_email' => 'foobar', 'copyright' => 'foobar', 'site_title' => 'foobar', 'author' => 'foobar', 'description' => 'foobar', 'thumbnail_constraint' => 'foobar', 'square_thumbnail_constraint' => 'foobar', 'fullsize_constraint' => 'foobar', 'per_page_admin' => 'foobar', 'per_page_public' => 'foobar', 'show_empty_elements' => 'foobar', 'path_to_convert' => 'foobar', Theme::ADMIN_THEME_OPTION => Installer_Default::DEFAULT_ADMIN_THEME, Theme::PUBLIC_THEME_OPTION => Installer_Default::DEFAULT_PUBLIC_THEME, Omeka_Validate_File_Extension::WHITELIST_OPTION => Omeka_Validate_File_Extension::DEFAULT_WHITELIST, Omeka_Validate_File_MimeType::WHITELIST_OPTION => Omeka_Validate_File_MimeType::DEFAULT_WHITELIST, File::DISABLE_DEFAULT_VALIDATION_OPTION => (string) (!extension_loaded('fileinfo')), Omeka_Db_Migration_Manager::VERSION_OPTION_NAME => OMEKA_VERSION, 'display_system_info' => true, 'html_purifier_is_enabled' => '1', 'html_purifier_allowed_html_elements' => 'foo', 'html_purifier_allowed_html_attributes' => 'bar', 'tag_delimiter' => ',', Omeka_Navigation::PUBLIC_NAVIGATION_MAIN_OPTION_NAME => 'foobar', 'search_record_types' => 'foobar', 'api_enable' => true, 'api_per_page' => 50, 'show_element_set_headings' => '1'));
     $task->install($this->db);
     $this->profilerHelper->assertDbQuery(array("INSERT INTO `test_options`", array(1 => File::DISABLE_DEFAULT_VALIDATION_OPTION, 2 => (string) (!extension_loaded('fileinfo')), 3 => File::DISABLE_DEFAULT_VALIDATION_OPTION, 4 => (string) (!extension_loaded('fileinfo')))), "Should have inserted options into the database.");
 }
Exemple #2
0
 private function _addOptions()
 {
     $task = new Installer_Task_Options();
     $task->setOptions(array('administrator_email' => $this->_getValue('administrator_email'), 'copyright' => $this->_getValue('copyright'), 'site_title' => $this->_getValue('site_title'), 'author' => $this->_getValue('author'), 'description' => $this->_getValue('description'), 'thumbnail_constraint' => $this->_getValue('thumbnail_constraint'), 'square_thumbnail_constraint' => $this->_getValue('square_thumbnail_constraint'), 'fullsize_constraint' => $this->_getValue('fullsize_constraint'), 'per_page_admin' => $this->_getValue('per_page_admin'), 'per_page_public' => $this->_getValue('per_page_public'), 'show_empty_elements' => $this->_getValue('show_empty_elements'), 'path_to_convert' => $this->_getValue('path_to_convert'), Theme::ADMIN_THEME_OPTION => Installer_Default::DEFAULT_ADMIN_THEME, Theme::PUBLIC_THEME_OPTION => Installer_Default::DEFAULT_PUBLIC_THEME, Omeka_Validate_File_Extension::WHITELIST_OPTION => Omeka_Validate_File_Extension::DEFAULT_WHITELIST, Omeka_Validate_File_MimeType::WHITELIST_OPTION => Omeka_Validate_File_MimeType::DEFAULT_WHITELIST, File::DISABLE_DEFAULT_VALIDATION_OPTION => (string) (!extension_loaded('fileinfo')), Omeka_Db_Migration_Manager::VERSION_OPTION_NAME => OMEKA_VERSION, 'display_system_info' => true, 'html_purifier_is_enabled' => 1, 'html_purifier_allowed_html_elements' => implode(',', Omeka_Filter_HtmlPurifier::getDefaultAllowedHtmlElements()), 'html_purifier_allowed_html_attributes' => implode(',', Omeka_Filter_HtmlPurifier::getDefaultAllowedHtmlAttributes()), 'tag_delimiter' => ',', Omeka_Navigation::PUBLIC_NAVIGATION_MAIN_OPTION_NAME => Omeka_Navigation::getNavigationOptionValueForInstall(Omeka_Navigation::PUBLIC_NAVIGATION_MAIN_OPTION_NAME), 'search_record_types' => serialize(get_search_record_types()), 'api_enable' => false, 'api_per_page' => 50, 'show_element_set_headings' => 1));
     $task->install($this->_db);
 }