public function ConfigImporterTest::testInvalidStep in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php \Drupal\KernelTests\Core\Config\ConfigImporterTest::testInvalidStep()
Tests that the isConfigSyncing flag is cleanup after an invalid step.
File
- core/
tests/ Drupal/ KernelTests/ Core/ Config/ ConfigImporterTest.php, line 799
Class
- ConfigImporterTest
- Tests importing configuration from files into active configuration.
Namespace
Drupal\KernelTests\Core\ConfigCode
public function testInvalidStep() {
$this
->assertFalse(\Drupal::isConfigSyncing(), 'Before an import \\Drupal::isConfigSyncing() returns FALSE');
$context = [];
try {
$this->configImporter
->doSyncStep('a_non_existent_step', $context);
$this
->fail('Expected \\InvalidArgumentException thrown');
} catch (\InvalidArgumentException $e) {
// Expected exception; just continue testing.
}
$this
->assertFalse(\Drupal::isConfigSyncing(), 'After an invalid step \\Drupal::isConfigSyncing() returns FALSE');
}