InstallerExistingConfigSyncDriectoryProfileMismatchTest.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace Drupal\FunctionalTests\Installer;
  3. /**
  4. * Verifies that installing from existing configuration works.
  5. *
  6. * @group Installer
  7. */
  8. class InstallerExistingConfigSyncDriectoryProfileMismatchTest extends InstallerExistingConfigTestBase {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. protected $profile = 'testing_config_install_multilingual';
  13. /**
  14. * {@inheritdoc}
  15. */
  16. protected $existingSyncDirectory = TRUE;
  17. /**
  18. * {@inheritdoc}
  19. */
  20. protected function getConfigTarball() {
  21. return __DIR__ . '/../../../fixtures/config_install/multilingual.tar.gz';
  22. }
  23. /**
  24. * Installer step: Configure settings.
  25. */
  26. protected function setUpSettings() {
  27. // Cause a profile mismatch by hacking the URL.
  28. $this->drupalGet(str_replace($this->profile, 'minimal', $this->getUrl()));
  29. parent::setUpSettings();
  30. }
  31. protected function setUpSite() {
  32. // This step will not occur because there is an error.
  33. return;
  34. }
  35. /**
  36. * Tests that profile mismatch fails to install.
  37. */
  38. public function testConfigSync() {
  39. $this->htmlOutput(NULL);
  40. $this->assertTitle('Configuration validation | Drupal');
  41. $this->assertText('The configuration synchronization failed validation.');
  42. $this->assertText('The selected installation profile minimal does not match the profile stored in configuration testing_config_install_multilingual.');
  43. // Ensure there is no continuation button.
  44. $this->assertNoText('Save and continue');
  45. $this->assertNoFieldById('edit-submit');
  46. }
  47. }