InstallerExistingDatabaseSettingsTest.php in Zircon Profile 8
File
core/modules/system/src/Tests/Installer/InstallerExistingDatabaseSettingsTest.php
View source
<?php
namespace Drupal\system\Tests\Installer;
use Drupal\simpletest\InstallerTestBase;
use Drupal\Core\Database\Database;
class InstallerExistingDatabaseSettingsTest extends InstallerTestBase {
protected function setUp() {
$connection_info = Database::getConnectionInfo();
unset($connection_info['default']['pdo']);
unset($connection_info['default']['init_commands']);
$this->settings['databases']['default'] = (object) array(
'value' => $connection_info,
'required' => TRUE,
);
parent::setUp();
}
protected function setUpSettings() {
$values = $this->parameters['forms']['install_settings_form'];
$driver = $values['driver'];
$edit = array();
if (isset($values[$driver]['password']) && $values[$driver]['password'] !== '') {
$edit = $this
->translatePostValues(array(
$driver => array(
'password' => $values[$driver]['password'],
),
));
}
$this
->drupalPostForm(NULL, $edit, $this->translations['Save and continue']);
}
public function testInstaller() {
$this
->assertUrl('user/1');
$this
->assertResponse(200);
}
}