function ConfigImportUITest::testBatchErrors

Same name in other branches
  1. 9 core/modules/config/tests/src/Functional/ConfigImportUITest.php \Drupal\Tests\config\Functional\ConfigImportUITest::testBatchErrors()
  2. 10 core/modules/config/tests/src/Functional/ConfigImportUITest.php \Drupal\Tests\config\Functional\ConfigImportUITest::testBatchErrors()
  3. 11.x core/modules/config/tests/src/Functional/ConfigImportUITest.php \Drupal\Tests\config\Functional\ConfigImportUITest::testBatchErrors()

Tests that errors set in the batch and on the ConfigImporter are merged.

File

core/modules/config/tests/src/Functional/ConfigImportUITest.php, line 533

Class

ConfigImportUITest
Tests the user interface for importing configuration.

Namespace

Drupal\Tests\config\Functional

Code

public function testBatchErrors() {
    $new_site_name = 'Config import test ' . $this->randomString();
    $this->prepareSiteNameUpdate($new_site_name);
    \Drupal::state()->set('config_import_steps_alter.error', TRUE);
    $this->drupalPostForm('admin/config/development/configuration', [], t('Import all'));
    $this->assertSession()
        ->responseContains('_config_import_test_config_import_steps_alter batch error');
    $this->assertSession()
        ->responseContains('_config_import_test_config_import_steps_alter ConfigImporter error');
    $this->assertSession()
        ->responseContains('The configuration was imported with errors.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.