function ConfigTest::testClear

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Config/ConfigTest.php \Drupal\Tests\Core\Config\ConfigTest::testClear()
  2. 8.9.x core/tests/Drupal/Tests/Core/Config/ConfigTest.php \Drupal\Tests\Core\Config\ConfigTest::testClear()
  3. 11.x core/tests/Drupal/Tests/Core/Config/ConfigTest.php \Drupal\Tests\Core\Config\ConfigTest::testClear()

@covers ::clear @dataProvider simpleDataProvider

File

core/tests/Drupal/Tests/Core/Config/ConfigTest.php, line 311

Class

ConfigTest
Tests the Config.

Namespace

Drupal\Tests\Core\Config

Code

public function testClear($data) : void {
    foreach ($data as $key => $value) {
        // Check that values are cleared.
        $this->config
            ->set($key, $value);
        $this->assertEquals($value, $this->config
            ->get($key));
        $this->config
            ->clear($key);
        $this->assertNull($this->config
            ->get($key));
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.