function ImmutableConfigTest::testClear

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

Tests clear.

@legacy-covers ::clear

File

core/tests/Drupal/Tests/Core/Config/ImmutableConfigTest.php, line 54

Class

ImmutableConfigTest
Tests Drupal\Core\Config\ImmutableConfig.

Namespace

Drupal\Tests\Core\Config

Code

public function testClear() : void {
  $this->expectException(ImmutableConfigException::class);
  $this->expectExceptionMessage('Can not clear name key in immutable configuration test. Use \\Drupal\\Core\\Config\\ConfigFactoryInterface::getEditable() to retrieve a mutable configuration object');
  $this->config
    ->clear('name');
}

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