Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / tests / Drupal / FunctionalTests / Installer / InstallerExistingConfigNoSystemSiteTest.php
diff --git a/web/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoSystemSiteTest.php b/web/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoSystemSiteTest.php
new file mode 100644 (file)
index 0000000..4ac68d4
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+
+namespace Drupal\FunctionalTests\Installer;
+
+/**
+ * Testing installing from config without system.site.
+ *
+ * @group Installer
+ */
+class InstallerExistingConfigNoSystemSiteTest extends InstallerExistingConfigTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function prepareEnvironment() {
+    parent::prepareEnvironment();
+    // File API functions are not available yet.
+    unlink($this->siteDirectory . '/profiles/' . $this->profile . '/config/sync/system.site.yml');
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setUpSite() {
+    return;
+  }
+
+  /**
+   * Tests that profiles with no system.site do not work.
+   */
+  public function testConfigSync() {
+    $this->htmlOutput(NULL);
+    $this->assertTitle('Configuration validation | Drupal');
+    $this->assertText('The configuration synchronization failed validation.');
+    $this->assertText('This import does not contain system.site configuration, so has been rejected.');
+
+    // Ensure there is no continuation button.
+    $this->assertNoText('Save and continue');
+    $this->assertNoFieldById('edit-submit');
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function getConfigTarball() {
+    return __DIR__ . '/../../../fixtures/config_install/testing_config_install.tar.gz';
+  }
+
+}