/** * @covers FOF30\Database\Installer::removeSchema */ public function testRemoveSchema() { $db = static::$container->db; $this->createTable(); $tables = $db->setQuery('SHOW TABLES')->loadColumn(); $prefix = $db->getPrefix(); $this->assertTrue(in_array($prefix . 'foobar_example', $tables), 'The table must exist before testing starts'); $installer = new Installer($db, __DIR__ . '/../_data/installer/pick_right'); $installer->removeSchema(); $tables = $db->setQuery('SHOW TABLES')->loadColumn(); $prefix = $db->getPrefix(); $this->assertFalse(in_array($prefix . 'foobar_example', $tables), 'The table must not exist after running removeSchema'); }
/** * Runs on uninstallation * * @param \JInstallerAdapterComponent $parent The parent object */ public function uninstall($parent) { // Uninstall database $dbInstaller = new Installer(JFactory::getDbo(), ($this->schemaXmlPathRelative ? JPATH_ADMINISTRATOR . '/components/' . $this->componentName : '') . '/' . $this->schemaXmlPath); $dbInstaller->removeSchema(); // Uninstall post-installation messages on Joomla! 3.2 and later $this->uninstallPostInstallationMessages(); // Remove ourselves from the list of extensions depending on FOF30 $this->removeDependency('fof30', $this->componentName); // Show the post-uninstallation page $this->renderPostUninstallation($parent); }