diff core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDriectoryProfileMismatchTest.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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDriectoryProfileMismatchTest.php	Thu Feb 28 13:21:36 2019 +0000
@@ -0,0 +1,57 @@
+<?php
+
+namespace Drupal\FunctionalTests\Installer;
+
+/**
+ * Verifies that installing from existing configuration works.
+ *
+ * @group Installer
+ */
+class InstallerExistingConfigSyncDriectoryProfileMismatchTest extends InstallerExistingConfigTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected $profile = 'testing_config_install_multilingual';
+
+  /**
+   * {@inheritdoc}
+   */
+  protected $existingSyncDirectory = TRUE;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function getConfigTarball() {
+    return __DIR__ . '/../../../fixtures/config_install/multilingual.tar.gz';
+  }
+
+  /**
+   * Installer step: Configure settings.
+   */
+  protected function setUpSettings() {
+    // Cause a profile mismatch by hacking the URL.
+    $this->drupalGet(str_replace($this->profile, 'minimal', $this->getUrl()));
+    parent::setUpSettings();
+  }
+
+  protected function setUpSite() {
+    // This step will not occur because there is an error.
+    return;
+  }
+
+  /**
+   * Tests that profile mismatch fails to install.
+   */
+  public function testConfigSync() {
+    $this->htmlOutput(NULL);
+    $this->assertTitle('Configuration validation | Drupal');
+    $this->assertText('The configuration synchronization failed validation.');
+    $this->assertText('The selected installation profile minimal does not match the profile stored in configuration testing_config_install_multilingual.');
+
+    // Ensure there is no continuation button.
+    $this->assertNoText('Save and continue');
+    $this->assertNoFieldById('edit-submit');
+  }
+
+}