public function ConfigTest::testNestedClear in Zircon Profile 8
Same name and namespace in other branches
- 8.0 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 297 - Contains \Drupal\Tests\Core\Config\ConfigTest.
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));
}
}
}