/** * 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 testGetAdminOptions() { $expectedOptions = array('frontname' => 'backend', 'username' => 'admin', 'password' => 'password1'); $this->assertEquals($expectedOptions, $this->_object->getAdminOptions()); }