comparison core/tests/Drupal/FunctionalTests/Installer/InstallerSkipPermissionHardeningTest.php @ 0:c75dbcec494b

Initial commit from drush-created site
author Chris Cannam
date Thu, 05 Jul 2018 14:24:15 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c75dbcec494b
1 <?php
2
3 namespace Drupal\FunctionalTests\Installer;
4
5 /**
6 * Verifies that the installer skipped permission hardening.
7 *
8 * @group Installer
9 */
10 class InstallerSkipPermissionHardeningTest extends InstallerTestBase {
11
12 /**
13 * {@inheritdoc}
14 */
15 protected function prepareEnvironment() {
16 parent::prepareEnvironment();
17 $this->settings['settings']['skip_permissions_hardening'] = (object) ['value' => TRUE, 'required' => TRUE];
18 }
19
20 /**
21 * {@inheritdoc}
22 */
23 protected function setUpSite() {
24 $site_directory = $this->container->get('app.root') . '/' . $this->siteDirectory;
25 $this->assertTrue(is_writable($site_directory));
26 $this->assertTrue(is_writable($site_directory . '/settings.php'));
27
28 $this->assertSession()->responseContains('All necessary changes to <em class="placeholder">' . $this->siteDirectory . '</em> and <em class="placeholder">' . $this->siteDirectory . '/settings.php</em> have been made, so you should remove write permissions to them now in order to avoid security risks. If you are unsure how to do so, consult the <a href="https://www.drupal.org/server-permissions">online handbook</a>.');
29
30 parent::setUpSite();
31 }
32
33 /**
34 * Verifies the expected behaviors of the installation result.
35 */
36 public function testInstalled() {
37 $this->assertSession()->addressEquals('user/1');
38 $this->assertSession()->statusCodeEquals(200);
39 }
40
41 }