Beispiel #1
0
 public function testRunInstaller()
 {
     $this->dbAdapter->appendLastInsertIdToStack(self::USERS_PLANS_ID);
     $this->dbAdapter->appendLastInsertIdToStack(self::USER_ID);
     $this->dbAdapter->appendLastInsertIdToStack(self::ENTITY_ID);
     $installer = new Installer_Default($this->db);
     $this->form->setDefaults(array('username' => 'foobar', 'password' => 'foobar', 'password_confirm' => 'foobar', 'super_email' => '*****@*****.**', 'administrator_email' => Omeka_Test_Resource_Db::SUPER_EMAIL, 'copyright' => Omeka_Test_Resource_Db::DEFAULT_COPYRIGHT, 'site_title' => Omeka_Test_Resource_Db::DEFAULT_SITE_TITLE, 'author' => Omeka_Test_Resource_Db::DEFAULT_AUTHOR, 'description' => Omeka_Test_Resource_Db::DEFAULT_DESCRIPTION, 'thumbnail_constraint' => Omeka_Form_Install::DEFAULT_THUMBNAIL_CONSTRAINT, 'square_thumbnail_constraint' => Omeka_Form_Install::DEFAULT_SQUARE_THUMBNAIL_CONSTRAINT, 'fullsize_constraint' => Omeka_Form_Install::DEFAULT_FULLSIZE_CONSTRAINT, 'per_page_admin' => Omeka_Form_Install::DEFAULT_PER_PAGE_ADMIN, 'per_page_public' => Omeka_Form_Install::DEFAULT_PER_PAGE_PUBLIC, 'show_empty_elements' => Omeka_Form_Install::DEFAULT_SHOW_EMPTY_ELEMENTS, 'path_to_convert' => '', 'tag_delimiter' => ','));
     $installer->setForm($this->form);
     $installer->install();
     $this->profilerHelper->assertDbQuery("CREATE TABLE IF NOT EXISTS `omeka_collections`", "Installer should have created the default Omeka schema.");
     $this->profilerHelper->assertDbQuery("CREATE TABLE IF NOT EXISTS `omeka_schema_migrations`", "Installer should have created the timestamp migrations table.");
     $this->profilerHelper->assertDbQuery("INSERT INTO `omeka_users`", "Installer should have created a new user.");
     $this->profilerHelper->assertDbQuery(array("INSERT INTO `omeka_options`", array(1 => 'site_title', 2 => 'Automated Test Installation', 3 => 'site_title', 4 => 'Automated Test Installation')), "Installer should have added appropriate database options.");
 }
Beispiel #2
0
 public function install()
 {
     parent::install();
     self::addItem($this->getDb());
 }