/** * Install application according to installation options * * @return \Magento\TestFramework\Application * @throws \Magento\Framework\Exception */ protected function _install() { $installOptions = $this->_config->getInstallOptions(); $installOptionsNoValue = $this->_config->getInstallOptionsNoValue(); if (!$installOptions) { throw new \Magento\Framework\Exception('Trying to install Magento, but installation options are not set'); } // Populate install options with global options $baseUrl = 'http://' . $this->_config->getApplicationUrlHost() . $this->_config->getApplicationUrlPath(); $installOptions = array_merge($installOptions, ['base_url' => $baseUrl, 'base_url_secure' => $baseUrl]); $installCmd = 'php -f %s install'; $installCmdArgs = [$this->_script]; foreach ($installOptions as $optionName => $optionValue) { $installCmd .= " --{$optionName}=%s"; $installCmdArgs[] = $optionValue; } foreach ($installOptionsNoValue as $optionName) { $installCmd .= " --{$optionName}"; } $this->_shell->execute($installCmd, $installCmdArgs); $this->_isInstalled = true; $this->_fixtures = []; return $this; }
/** * Install application according to installation options * * @return \Magento\TestFramework\Application * @throws \Magento\Framework\Exception */ protected function _install() { $installOptions = $this->_config->getInstallOptions(); if (!$installOptions) { throw new \Magento\Framework\Exception('Trying to install Magento, but installation options are not set'); } // Populate install options with global options $baseUrl = 'http://' . $this->_config->getApplicationUrlHost() . $this->_config->getApplicationUrlPath(); $installOptions = array_merge($installOptions, array('url' => $baseUrl, 'secure_base_url' => $baseUrl)); $adminOptions = $this->_config->getAdminOptions(); foreach ($adminOptions as $key => $val) { $installOptions['admin_' . $key] = $val; } $installCmd = 'php -f %s --'; $installCmdArgs = array($this->_installerScript); foreach ($installOptions as $optionName => $optionValue) { $installCmd .= " --{$optionName} %s"; $installCmdArgs[] = $optionValue; } $this->_shell->execute($installCmd, $installCmdArgs); $this->_isInstalled = true; $this->_fixtures = array(); return $this; }
public function testGetInstallOptions() { $expectedOptions = ['option1' => 'value 1', 'option2' => 'value 2', 'backend-frontname' => 'backend', 'admin-user' => 'admin', 'admin-password' => 'password1']; $this->assertEquals($expectedOptions, $this->_object->getInstallOptions()); }
public function testGetInstallOptions() { $expectedOptions = array('option1' => 'value 1', 'option2' => 'value 2'); $this->assertEquals($expectedOptions, $this->_object->getInstallOptions()); }