You are here

public function ImmutableConfigTest::testClear in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Config/ImmutableConfigTest.php \Drupal\Tests\Core\Config\ImmutableConfigTest::testClear()

@covers ::clear

File

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

Class

ImmutableConfigTest
@coversDefaultClass \Drupal\Core\Config\ImmutableConfig @group Config

Namespace

Drupal\Tests\Core\Config

Code

public function testClear() {
  $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');
}