function TestStorage::setValue

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

Provides a setter to bypass the array type hint on ::write().

This method allows us to create invalid configurations. The method ::write() only allows values of the type array.

File

core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php, line 182

Class

TestStorage
Provides a test implementation of <a href="/api/drupal/core%21lib%21Drupal%21Core%21Config%21StorageInterface.php/interface/StorageInterface/11.x" title="Defines an interface for configuration storage." class="local">\Drupal\Core\Config\StorageInterface</a>.

Namespace

Drupal\Tests\Core\Config

Code

public function setValue($name, $value) {
    $this->config[$this->collection][$name] = $value;
}

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