Mercurial > hg > isophonics-drupal-site
comparison core/tests/Drupal/FunctionalTests/Installer/InstallerSiteConfigProfileTest.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\FunctionalTests\Installer; | |
4 | |
5 /** | |
6 * Verifies that the installer defaults to the existing site email address and | |
7 * timezone, if they were provided by the install profile. | |
8 * | |
9 * @group Installer | |
10 */ | |
11 class InstallerSiteConfigProfileTest extends InstallerTestBase { | |
12 | |
13 /** | |
14 * {@inheritdoc} | |
15 */ | |
16 protected $profile = 'testing_site_config'; | |
17 | |
18 /** | |
19 * The site mail we expect to be set from the install profile. | |
20 * | |
21 * @see testing_site_config_install() | |
22 */ | |
23 const EXPECTED_SITE_MAIL = 'profile-testing-site-config@example.com'; | |
24 | |
25 /** | |
26 * The timezone we expect to be set from the install profile. | |
27 * | |
28 * @see testing_site_config_install() | |
29 */ | |
30 const EXPECTED_TIMEZONE = 'America/Los_Angeles'; | |
31 | |
32 /** | |
33 * {@inheritdoc} | |
34 */ | |
35 protected function installParameters() { | |
36 $parameters = parent::installParameters(); | |
37 | |
38 // Don't override the site email address, allowing it to default to the one | |
39 // from our install profile. | |
40 unset($parameters['forms']['install_configure_form']['site_mail']); | |
41 | |
42 return $parameters; | |
43 } | |
44 | |
45 /** | |
46 * {@inheritdoc} | |
47 */ | |
48 protected function setUpSite() { | |
49 $this->assertFieldByName('site_mail', self::EXPECTED_SITE_MAIL); | |
50 $this->assertFieldByName('date_default_timezone', self::EXPECTED_TIMEZONE); | |
51 | |
52 return parent::setUpSite(); | |
53 } | |
54 | |
55 /** | |
56 * Verify the correct site config was set. | |
57 */ | |
58 public function testInstaller() { | |
59 $this->assertEqual($this->config('system.site')->get('mail'), self::EXPECTED_SITE_MAIL); | |
60 $this->assertEqual($this->config('system.date')->get('timezone.default'), self::EXPECTED_TIMEZONE); | |
61 } | |
62 | |
63 } |