InstallerExistingConfigSyncDriectoryProfileMismatchTest.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 $defaultTheme = 'stark';
  13. /**
  14. * {@inheritdoc}
  15. */
  16. protected $profile = 'testing_config_install_multilingual';
  17. /**
  18. * {@inheritdoc}
  19. */
  20. protected $existingSyncDirectory = TRUE;
  21. /**
  22. * {@inheritdoc}
  23. */
  24. protected function getConfigTarball() {
  25. return __DIR__ . '/../../../fixtures/config_install/multilingual.tar.gz';
  26. }
  27. /**
  28. * Installer step: Configure settings.
  29. */
  30. protected function setUpSettings() {
  31. // Cause a profile mismatch by hacking the URL.
  32. $this->drupalGet(str_replace($this->profile, 'minimal', $this->getUrl()));
  33. parent::setUpSettings();
  34. }
  35. protected function setUpSite() {
  36. // This step will not occur because there is an error.
  37. return;
  38. }
  39. /**
  40. * Tests that profile mismatch fails to install.
  41. */
  42. public function testConfigSync() {
  43. $this->htmlOutput(NULL);
  44. $this->assertTitle('Configuration validation | Drupal');
  45. $this->assertText('The configuration synchronization failed validation.');
  46. $this->assertText('The selected installation profile minimal does not match the profile stored in configuration testing_config_install_multilingual.');
  47. // Ensure there is no continuation button.
  48. $this->assertNoText('Save and continue');
  49. $this->assertNoFieldById('edit-submit');
  50. }
  51. }