Version 1
[yaffs-website] / web / core / modules / system / src / Tests / Installer / StandardInstallerTest.php
1 <?php
2
3 namespace Drupal\system\Tests\Installer;
4
5 /**
6  * Tests the interactive installer installing the standard profile.
7  *
8  * @group Installer
9  */
10 class StandardInstallerTest extends ConfigAfterInstallerTestBase {
11
12   /**
13    * {@inheritdoc}
14    */
15   protected $profile = 'standard';
16
17   /**
18    * Ensures that the user page is available after installation.
19    */
20   public function testInstaller() {
21     // Verify that the confirmation message appears.
22     require_once \Drupal::root() . '/core/includes/install.inc';
23     $this->assertRaw(t('Congratulations, you installed @drupal!', [
24       '@drupal' => drupal_install_profile_distribution_name(),
25     ]));
26   }
27
28   /**
29    * {@inheritdoc}
30    */
31   protected function setUpSite() {
32     // Test that the correct theme is being used.
33     $this->assertNoRaw('bartik');
34     $this->assertRaw('themes/seven/css/theme/install-page.css');
35     parent::setUpSite();
36   }
37
38   /**
39    * {@inheritdoc}
40    */
41   protected function curlExec($curl_options, $redirect = FALSE) {
42     // Ensure that we see the classy progress CSS on the batch page.
43     // Batch processing happens as part of HTTP redirects, so we can access the
44     // HTML of the batch page.
45     if (strpos($curl_options[CURLOPT_URL], '&id=1&op=do_nojs') !== FALSE) {
46       $this->assertRaw('themes/classy/css/components/progress.css');
47     }
48     return parent::curlExec($curl_options, $redirect);
49   }
50
51   /**
52    * Ensures that the exported standard configuration is up to date.
53    */
54   public function testStandardConfig() {
55     $skipped_config = [];
56     // \Drupal\simpletest\WebTestBase::installParameters() uses
57     // simpletest@example.com as mail address.
58     $skipped_config['contact.form.feedback'][] = '- simpletest@example.com';
59     // \Drupal\filter\Entity\FilterFormat::toArray() drops the roles of filter
60     // formats.
61     $skipped_config['filter.format.basic_html'][] = 'roles:';
62     $skipped_config['filter.format.basic_html'][] = '- authenticated';
63     $skipped_config['filter.format.full_html'][] = 'roles:';
64     $skipped_config['filter.format.full_html'][] = '- administrator';
65     $skipped_config['filter.format.restricted_html'][] = 'roles:';
66     $skipped_config['filter.format.restricted_html'][] = '- anonymous';
67
68     $this->assertInstalledConfig($skipped_config);
69   }
70
71 }