function ConfigTest::testNestedClear
Same name in other branches
- 9 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()
- 11.x 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 318
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));
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.