InstallerSiteConfigProfileTest.php in Drupal 9
File
core/tests/Drupal/FunctionalTests/Installer/InstallerSiteConfigProfileTest.php
View source
<?php
namespace Drupal\FunctionalTests\Installer;
class InstallerSiteConfigProfileTest extends InstallerTestBase {
protected $defaultTheme = 'stark';
protected $profile = 'testing_site_config';
const EXPECTED_SITE_MAIL = 'profile-testing-site-config@example.com';
const EXPECTED_TIMEZONE = 'America/Los_Angeles';
protected function installParameters() {
$parameters = parent::installParameters();
unset($parameters['forms']['install_configure_form']['site_mail']);
return $parameters;
}
protected function setUpSite() {
$this
->assertSession()
->fieldValueEquals('site_mail', self::EXPECTED_SITE_MAIL);
$this
->assertSession()
->fieldValueEquals('date_default_timezone', self::EXPECTED_TIMEZONE);
return parent::setUpSite();
}
public function testInstaller() {
$this
->assertEquals(self::EXPECTED_SITE_MAIL, $this
->config('system.site')
->get('mail'));
$this
->assertEquals(self::EXPECTED_TIMEZONE, $this
->config('system.date')
->get('timezone.default'));
}
}
Classes
Name |
Description |
InstallerSiteConfigProfileTest |
Verifies that the installer defaults to the existing site email address and
timezone, if they were provided by the install profile. |