public function ConfigTest::testNestedClear in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Config/ConfigTest.php \Drupal\Tests\Core\Config\ConfigTest::testNestedClear()
- 10 core/tests/Drupal/Tests/Core/Config/ConfigTest.php \Drupal\Tests\Core\Config\ConfigTest::testNestedClear()
@covers ::clear @dataProvider nestedDataProvider
File
- core/
tests/ Drupal/ Tests/ Core/ Config/ ConfigTest.php, line 322
Class
- ConfigTest
- Tests the Config.
Namespace
Drupal\Tests\Core\ConfigCode
public function testNestedClear($data) {
foreach ($data as $key => $value) {
// Check that values are cleared.
$this->config
->set($key, $value);
// Check each nested value.
foreach ($value as $nested_key => $nested_value) {
$full_nested_key = $key . '.' . $nested_key;
$this
->assertEquals($nested_value, $this->config
->get($full_nested_key));
$this->config
->clear($full_nested_key);
$this
->assertNull($this->config
->get($full_nested_key));
}
}
}