+ if (!empty($assertion[$cat][$key])) {
+ $this->assertEquals($assertion[$cat][$key], $this->configCache->get($cat, $key));
+ } elseif (!empty($assertion) && !is_array($assertion)) {
+ $this->assertEquals($assertion, $this->configCache->get($cat, $key));
+ } elseif (!empty($default_value)) {
+ $this->assertEquals($default_value, $this->configCache->get($cat, $key));
+ } else {
+ $this->assertEmpty($this->configCache->get($cat, $key), $this->configCache->get($cat, $key));
+ }
+ }
+
+ /**
+ * Asserts all config entries
+ *
+ * @param null|array $assertion The optional assertion array
+ * @param boolean $saveDb True, if the db credentials should get saved to the file
+ * @param boolean $default True, if we use the default values
+ * @param boolean $defaultDb True, if we use the default value for the DB
+ * @param boolean $realBasepath True, if we use the real basepath of the installation, not the mocked one
+ */
+ public function assertConfig($assertion = null, $saveDb = false, $default = true, $defaultDb = true, $realBasepath = false)
+ {
+ if (!empty($assertion['database']['hostname'])) {
+ $assertion['database']['hostname'] .= (!empty($assertion['database']['port']) ? ':' . $assertion['database']['port'] : '');
+ }
+
+ $this->assertConfigEntry('database', 'hostname', ($saveDb) ? $assertion : null, (!$saveDb || $defaultDb) ? Installer::DEFAULT_HOST : null);
+ $this->assertConfigEntry('database', 'username', ($saveDb) ? $assertion : null);
+ $this->assertConfigEntry('database', 'password', ($saveDb) ? $assertion : null);
+ $this->assertConfigEntry('database', 'database', ($saveDb) ? $assertion : null);
+
+ $this->assertConfigEntry('config', 'admin_email', $assertion);
+ $this->assertConfigEntry('config', 'php_path', trim(shell_exec('which php')));
+ $this->assertConfigEntry('config', 'hostname', $assertion);
+
+ $this->assertConfigEntry('system', 'default_timezone', $assertion, ($default) ? Installer::DEFAULT_TZ : null);
+ $this->assertConfigEntry('system', 'language', $assertion, ($default) ? Installer::DEFAULT_LANG : null);
+ $this->assertConfigEntry('system', 'url', $assertion);
+ $this->assertConfigEntry('system', 'urlpath', $assertion);
+ $this->assertConfigEntry('system', 'ssl_policy', $assertion, ($default) ? BaseURL::DEFAULT_SSL_SCHEME : null);
+ $this->assertConfigEntry('system', 'basepath', ($realBasepath) ? $this->root->url() : $assertion);
+ }
+
+ /**
+ * Test the automatic installation without any parameter/setting
+ * Should stuck because of missing hostname
+ */
+ public function testEmpty()
+ {
+ $console = new AutomaticInstallation($this->consoleArgv);
+
+ $txt = $this->dumpExecute($console);