/** * tearDown * * @since 3.0.0 */ public function tearDown() { $installer = new Installer($this->_config); $installer->init(); $installer->rawDrop(); $this->_config->set('dbPrefix', $this->_configArray['dbPrefix']); }
/** * install the database * * @since 3.0.0 * * @return boolean */ protected function _database() { $installer = new Installer($this->_config); $installer->init(); $installer->rawDrop(); return Db::getStatus() === 1; }
/** * tearDown * * @since 3.0.0 */ public function tearDown() { $installer = new Installer($this->_config); $installer->init(); $installer->rawDrop(); $this->_request->setServer('argv', null); $this->_config->set('dbPrefix', $this->_configArray['dbPrefix']); }
/** * reinstall * * @since 2.4.0 */ protected static function _reinstall() { $installer = new Installer(GlobalConfig::getInstance()); $installer->init(); $installer->rawDrop(); $installer->rawCreate(); $installer->insertData(array('adminName' => 'Admin', 'adminUser' => 'admin', 'adminPassword' => 'admin', 'adminEmail' => 'admin@localhost')); /* process modules */ foreach (self::$_config['modules'] as $key => $value) { if (is_dir('modules/' . $key)) { $module = new $value(); $module->install(); } } /* access and filter */ Db::forTablePrefix('groups')->findMany()->set(array('modules' => null, 'filter' => 1))->save(); }
/** * testRawDrop * * @since 2.4.0 */ public function testRawDrop() { /* setup */ $installer = new Installer(); $installer->init($this->_config); $installer->rawDrop(); /* actual */ $actual = Db::countTablePrefix(); /* compare */ $this->assertEquals(0, $actual); }
/** * install the database * * @since 3.0.0 * * @param array $installArray * * @return array */ protected function _install($installArray = []) { $adminName = $installArray['adminName']; $adminUser = $installArray['adminUser']; $adminPassword = $installArray['adminPassword']; $adminEmail = $installArray['adminEmail']; if ($adminName && $adminUser && $adminPassword && $adminEmail) { $installer = new Installer($this->_config); $installer->init(); $installer->rawDrop(); $installer->rawCreate(); $installer->insertData(['adminName' => $installArray['adminName'], 'adminUser' => $installArray['adminUser'], 'adminPassword' => $installArray['adminPassword'], 'adminEmail' => $installArray['adminEmail']]); return Db::getStatus() === 2; } return false; }