/**
  * test database population.
  *
  * @return void
  */
 public function testPopulate()
 {
     $this->skipIf(getenv('DB') == 'mysql', 'MySQL installation on CI server fails.');
     $this->_dropTables();
     $config = (include ROOT . '/config/settings.php');
     $result = $this->installer->install($this->_getConn());
     $this->assertTrue($result);
     $this->assertEmpty($this->installer->errors());
 }
 /**
  * Fourth step of the installation process.
  *
  * User must introduce database connection information.
  *
  * @return void
  */
 public function database()
 {
     if (!$this->_step('license')) {
         $this->redirect(['plugin' => 'Installer', 'controller' => 'startup', 'action' => 'license']);
     }
     if (!empty($this->request->data)) {
         $dbInstaller = new DatabaseInstaller();
         if ($dbInstaller->install($this->request->data())) {
             $this->_step();
             $this->redirect(['plugin' => 'Installer', 'controller' => 'startup', 'action' => 'account']);
         } else {
             $errors = '';
             foreach ($dbInstaller->errors() as $error) {
                 $errors .= "\t<li>{$error}</li>\n";
             }
             $this->Flash->danger("<ul>\n{$errors}</ul>\n");
         }
     }
     $this->title(__d('installer', 'Database Configuration'));
 }