Mercurial > hg > isophonics-drupal-site
diff core/modules/system/src/Tests/Installer/StandardInstallerTest.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children | 1fec387a4317 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/system/src/Tests/Installer/StandardInstallerTest.php Wed Nov 29 16:09:58 2017 +0000 @@ -0,0 +1,71 @@ +<?php + +namespace Drupal\system\Tests\Installer; + +/** + * Tests the interactive installer installing the standard profile. + * + * @group Installer + */ +class StandardInstallerTest extends ConfigAfterInstallerTestBase { + + /** + * {@inheritdoc} + */ + protected $profile = 'standard'; + + /** + * Ensures that the user page is available after installation. + */ + public function testInstaller() { + // Verify that the confirmation message appears. + require_once \Drupal::root() . '/core/includes/install.inc'; + $this->assertRaw(t('Congratulations, you installed @drupal!', [ + '@drupal' => drupal_install_profile_distribution_name(), + ])); + } + + /** + * {@inheritdoc} + */ + protected function setUpSite() { + // Test that the correct theme is being used. + $this->assertNoRaw('bartik'); + $this->assertRaw('themes/seven/css/theme/install-page.css'); + parent::setUpSite(); + } + + /** + * {@inheritdoc} + */ + protected function curlExec($curl_options, $redirect = FALSE) { + // Ensure that we see the classy progress CSS on the batch page. + // Batch processing happens as part of HTTP redirects, so we can access the + // HTML of the batch page. + if (strpos($curl_options[CURLOPT_URL], '&id=1&op=do_nojs') !== FALSE) { + $this->assertRaw('themes/classy/css/components/progress.css'); + } + return parent::curlExec($curl_options, $redirect); + } + + /** + * Ensures that the exported standard configuration is up to date. + */ + public function testStandardConfig() { + $skipped_config = []; + // \Drupal\simpletest\WebTestBase::installParameters() uses + // simpletest@example.com as mail address. + $skipped_config['contact.form.feedback'][] = '- simpletest@example.com'; + // \Drupal\filter\Entity\FilterFormat::toArray() drops the roles of filter + // formats. + $skipped_config['filter.format.basic_html'][] = 'roles:'; + $skipped_config['filter.format.basic_html'][] = '- authenticated'; + $skipped_config['filter.format.full_html'][] = 'roles:'; + $skipped_config['filter.format.full_html'][] = '- administrator'; + $skipped_config['filter.format.restricted_html'][] = 'roles:'; + $skipped_config['filter.format.restricted_html'][] = '- anonymous'; + + $this->assertInstalledConfig($skipped_config); + } + +}