InstallerExistingSettingsNoProfileTest.php in Drupal 9
File
core/tests/Drupal/FunctionalTests/Installer/InstallerExistingSettingsNoProfileTest.php
View source
<?php
namespace Drupal\FunctionalTests\Installer;
use Drupal\Core\DrupalKernel;
use Drupal\Core\Database\Database;
use Symfony\Component\HttpFoundation\Request;
class InstallerExistingSettingsNoProfileTest extends InstallerTestBase {
protected $defaultTheme = 'stark';
protected function prepareEnvironment() {
parent::prepareEnvironment();
$this->settings['settings']['hash_salt'] = (object) [
'value' => __CLASS__,
'required' => TRUE,
];
$connection_info = Database::getConnectionInfo();
unset($connection_info['default']['pdo']);
unset($connection_info['default']['init_commands']);
$this->settings['databases']['default'] = (object) [
'value' => $connection_info,
'required' => TRUE,
];
$this->settings['settings']['config_sync_directory'] = (object) [
'value' => DrupalKernel::findSitePath(Request::createFromGlobals()) . '/files/config_sync',
'required' => TRUE,
];
mkdir($this->settings['settings']['config_sync_directory']->value, 0777, TRUE);
}
protected function setUpSettings() {
}
public function testInstaller() {
$this
->assertSession()
->addressEquals('user/1');
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertEquals('testing', \Drupal::installProfile());
}
}