Unverified Commit 7493e886 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2540794 by Eli-T, cilefen, karishmaamin, cosmicdreams, yoroy:...

Issue #2540794 by Eli-T, cilefen, karishmaamin, cosmicdreams, yoroy: Configuration synchronization UI does not distinguish between an empty staged configuration, and staged configuration that matches active
parent 44a1bff1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -213,7 +213,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
        '#type' => 'table',
        '#header' => [$this->t('Name'), $this->t('Operations')],
        '#rows' => [],
        '#empty' => $this->t('There are no configuration changes to import.'),
        '#empty' => empty($source_list) ? $this->t('There is no staged configuration.') : $this->t('The staged configuration is identical to the active configuration.'),
      ];
      $form['actions']['#access'] = FALSE;
      return $form;
+6 −6
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ public function testExportImport() {
    // After installation there is no snapshot and nothing to import.
    $this->drupalGet('admin/config/development/configuration');
    $this->assertSession()->pageTextNotContains('Warning message');
    $this->assertSession()->pageTextContains('There are no configuration changes to import.');
    $this->assertSession()->pageTextContains('There is no staged configuration.');

    $this->originalSlogan = $this->config('system.site')->get('slogan');
    $this->newSlogan = $this->randomString(16);
@@ -171,13 +171,13 @@ public function testExportImport() {
    $this->submitForm(['files[import_tarball]' => $filename], 'Upload');
    // There is no snapshot yet because an import has never run.
    $this->assertSession()->pageTextNotContains('Warning message');
    $this->assertSession()->pageTextNotContains('There are no configuration changes to import.');
    $this->assertSession()->pageTextNotContains('There is no staged configuration.');
    $this->assertSession()->pageTextContains($this->contentType->label());

    $this->submitForm([], 'Import all');
    // After importing the snapshot has been updated and there are no warnings.
    $this->assertSession()->pageTextNotContains('Warning message');
    $this->assertSession()->pageTextContains('There are no configuration changes to import.');
    $this->assertSession()->pageTextContains('The staged configuration is identical to the active configuration.');

    $this->assertEquals($this->newSlogan, $this->config('system.site')->get('slogan'));

@@ -199,7 +199,7 @@ public function testExportImport() {
    $this->drupalGet('admin/config/development/configuration');
    $this->assertSession()->pageTextNotContains('Warning message');
    $this->assertSession()->pageTextNotContains('The following items in your active configuration have changes since the last import that may be lost on the next import.');
    $this->assertSession()->pageTextContains('There are no configuration changes to import.');
    $this->assertSession()->pageTextContains('There is no staged configuration.');
    // Write a file to sync. The warning about differences between the active
    // and snapshot should now exist.
    /** @var \Drupal\Core\Config\StorageInterface $sync */
@@ -282,7 +282,7 @@ public function testExportImportCollections() {
    $this->submitForm(['files[import_tarball]' => $filename], 'Upload');
    // Verify that there are configuration differences to import.
    $this->drupalGet('admin/config/development/configuration');
    $this->assertSession()->pageTextNotContains('There are no configuration changes to import.');
    $this->assertSession()->pageTextNotContains('There is no staged configuration.');
    $this->assertSession()->pageTextContains('collection.test1 configuration collection');
    $this->assertSession()->pageTextContains('collection.test2 configuration collection');
    $this->assertSession()->pageTextContains('config_test.create');
@@ -299,7 +299,7 @@ public function testExportImportCollections() {
    $this->assertSession()->linkByHrefExists('admin/config/development/configuration/sync/diff_collection/collection.test2/config_test.another_delete');

    $this->submitForm([], 'Import all');
    $this->assertSession()->pageTextContains('There are no configuration changes to import.');
    $this->assertSession()->pageTextContains('The staged configuration is identical to the active configuration.');

    // Test data in collections.
    $data = $test1_storage->read('config_test.create');
+7 −7
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ public function testImport() {
    $sync = $this->container->get('config.storage.sync');

    $this->drupalGet('admin/config/development/configuration');
    $this->assertSession()->pageTextContains('There are no configuration changes to import.');
    $this->assertSession()->pageTextContains('The staged configuration is identical to the active configuration.');
    $this->assertSession()->buttonNotExists('Import all');

    // Create updated configuration object.
@@ -137,7 +137,7 @@ public function testImport() {
    $this->assertSession()->buttonNotExists('Import all');

    // Verify that there are no further changes to import.
    $this->assertSession()->pageTextContains('There are no configuration changes to import.');
    $this->assertSession()->pageTextContains('The staged configuration is identical to the active configuration.');

    $this->rebuildContainer();
    // Verify site name has changed.
@@ -239,7 +239,7 @@ public function testImportLock() {

    // Verify that there are configuration differences to import.
    $this->drupalGet('admin/config/development/configuration');
    $this->assertSession()->pageTextNotContains('There are no configuration changes to import.');
    $this->assertSession()->pageTextNotContains('The staged configuration is identical to the active configuration.');

    // Acquire a fake-lock on the import mechanism.
    $config_importer = $this->configImporter();
@@ -363,7 +363,7 @@ public function testImportValidation() {
    $this->prepareSiteNameUpdate($new_site_name);

    $this->drupalGet('admin/config/development/configuration');
    $this->assertSession()->pageTextNotContains('There are no configuration changes to import.');
    $this->assertSession()->pageTextNotContains('The staged configuration is identical to the active configuration.');
    $this->submitForm([], 'Import all');

    // Verify that the validation messages appear.
@@ -440,14 +440,14 @@ public function testImportErrorLog() {
    $sync->write($name_secondary, $values_secondary);
    // Verify that there are configuration differences to import.
    $this->drupalGet('admin/config/development/configuration');
    $this->assertSession()->pageTextNotContains('There are no configuration changes to import.');
    $this->assertSession()->pageTextNotContains('The staged configuration is identical to the active configuration.');

    // Attempt to import configuration and verify that an error message appears.
    $this->submitForm([], 'Import all');
    $this->assertSession()->pageTextContains('Deleted and replaced configuration entity "' . $name_secondary . '"');
    $this->assertSession()->pageTextContains('The configuration was imported with errors.');
    $this->assertSession()->pageTextNotContains('The configuration was imported successfully.');
    $this->assertSession()->pageTextContains('There are no configuration changes to import.');
    $this->assertSession()->pageTextContains('The staged configuration is identical to the active configuration.');
  }

  /**
@@ -486,7 +486,7 @@ public function testEntityBundleDelete() {
    $node->delete();
    $this->submitForm([], 'Import all');
    $this->assertSession()->pageTextNotContains($validation_message);
    $this->assertSession()->pageTextContains('There are no configuration changes to import.');
    $this->assertSession()->pageTextContains('The staged configuration is identical to the active configuration.');
    $this->assertSession()->pageTextNotContains('node.type.' . $node_type->id());
    $this->assertSession()->pageTextNotContains('field.field.node.' . $node_type->id() . '.body');
    $this->assertSession()->pageTextNotContains('core.entity_view_display.node.' . $node_type->id() . '.teaser');