function ConfigImporterTest::testEmptyImportFails

Tests that trying to import from an empty staging configuration directory fails.

File

drupal/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php, line 86
Contains \Drupal\config\Tests\ConfigImporterTest.

Class

ConfigImporterTest
Tests importing configuration from files into active configuration.

Namespace

Drupal\config\Tests

Code

function testEmptyImportFails() {
  try {
    $this->container
      ->get('config.storage.staging')
      ->deleteAll();
    $this->configImporter
      ->reset()
      ->import();
    $this
      ->assertFalse(FALSE, "ConfigImporterException not thrown, we didn't stop an empty import.");
  } catch (ConfigImporterException $e) {
    $this
      ->assertTrue(TRUE, 'ConfigImporterException thrown, successfully stopping an empty import.');
  }
}