function ImmutableConfigTest::testSet

Same name and namespace in other branches
  1. 11.x 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()
  3. 9 core/tests/Drupal/Tests/Core/Config/ImmutableConfigTest.php \Drupal\Tests\Core\Config\ImmutableConfigTest::testSet()
  4. 8.9.x core/tests/Drupal/Tests/Core/Config/ImmutableConfigTest.php \Drupal\Tests\Core\Config\ImmutableConfigTest::testSet()

Tests set.

File

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

Class

ImmutableConfigTest
Tests Drupal\Core\Config\ImmutableConfig.

Namespace

Drupal\Tests\Core\Config

Code

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

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