function ConfigImporterTest::testEmptyImportFails

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php \Drupal\KernelTests\Core\Config\ConfigImporterTest::testEmptyImportFails()
  2. 8.9.x core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php \Drupal\KernelTests\Core\Config\ConfigImporterTest::testEmptyImportFails()
  3. 11.x core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php \Drupal\KernelTests\Core\Config\ConfigImporterTest::testEmptyImportFails()

Tests that trying to import from empty sync configuration directory fails.

File

core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php, line 64

Class

ConfigImporterTest
Tests importing configuration from files into active configuration.

Namespace

Drupal\KernelTests\Core\Config

Code

public function testEmptyImportFails() : void {
    $this->expectException(ConfigImporterException::class);
    $this->container
        ->get('config.storage.sync')
        ->deleteAll();
    $this->configImporter()
        ->import();
}

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