InstallerExistingConfigSyncDriectoryProfileMismatchTest.php 1.55 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
<?php

namespace Drupal\FunctionalTests\Installer;

/**
 * Verifies that installing from existing configuration works.
 *
 * @group Installer
 */
class InstallerExistingConfigSyncDriectoryProfileMismatchTest extends InstallerExistingConfigTestBase {

12 13 14 15 16
  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';

17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
  /**
   * {@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.
  }

  /**
   * Tests that profile mismatch fails to install.
   */
  public function testConfigSync() {
    $this->htmlOutput(NULL);
52
    $this->assertSession()->titleEquals('Configuration validation | Drupal');
53 54 55 56 57 58 59 60 61
    $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');
  }

}