You are here

public function ImmutableConfigTest::testSet in Drupal 8

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

@covers ::set

File

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

Class

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

Namespace

Drupal\Tests\Core\Config

Code

public function testSet() {
  $this
    ->expectException(ImmutableConfigException::class);
  $this
    ->expectExceptionMessage('Can not set values on immutable configuration test:name. Use \\Drupal\\Core\\Config\\ConfigFactoryInterface::getEditable() to retrieve a mutable configuration object');
  $this->config
    ->set('name', 'value');
}