class TestStorage

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

Provides a test implementation of \Drupal\Core\Config\StorageInterface.

Hierarchy

Expanded class hierarchy of TestStorage

File

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

Namespace

Drupal\Tests\Core\Config
View source
class TestStorage extends MemoryStorage {
  
  /**
   * Provides a setter to bypass the array typehint on ::write().
   *
   * This method allows us to create invalid configurations. The method
   * ::write() only allows values of the type array.
   */
  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.