1. 8.5.x core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageTest.php
  2. 8.5.x core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php
  3. 8.0.x core/modules/config/src/Tests/Storage/DatabaseStorageTest.php
  4. 8.0.x core/modules/system/src/Tests/KeyValueStore/DatabaseStorageTest.php
  5. 8.1.x core/modules/system/src/Tests/KeyValueStore/DatabaseStorageTest.php
  6. 8.1.x core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php
  7. 8.2.x core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php
  8. 8.2.x core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageTest.php
  9. 8.3.x core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageTest.php
  10. 8.3.x core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php
  11. 8.4.x core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageTest.php
  12. 8.4.x core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php
  13. 8.6.x core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php
  14. 8.6.x core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageTest.php

Namespace

Drupal\KernelTests\Core\Config\Storage

File

core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php
View source
<?php

namespace Drupal\KernelTests\Core\Config\Storage;

use Drupal\Core\Config\DatabaseStorage;

/**
 * Tests DatabaseStorage operations.
 *
 * @group config
 */
class DatabaseStorageTest extends ConfigStorageTestBase {

  /**
   * {@inheritdoc}
   */
  protected function setUp() {
    parent::setUp();
    $this->storage = new DatabaseStorage($this->container
      ->get('database'), 'config');
    $this->invalidStorage = new DatabaseStorage($this->container
      ->get('database'), 'invalid');

    // ::listAll() verifications require other configuration data to exist.
    $this->storage
      ->write('system.performance', array());
  }
  protected function read($name) {
    $data = db_query('SELECT data FROM {config} WHERE name = :name', array(
      ':name' => $name,
    ))
      ->fetchField();
    return unserialize($data);
  }
  protected function insert($name, $data) {
    db_insert('config')
      ->fields(array(
      'name' => $name,
      'data' => $data,
    ))
      ->execute();
  }
  protected function update($name, $data) {
    db_update('config')
      ->fields(array(
      'data' => $data,
    ))
      ->condition('name', $name)
      ->execute();
  }
  protected function delete($name) {
    db_delete('config')
      ->condition('name', $name)
      ->execute();
  }

}

Classes

Namesort descending Description
DatabaseStorageTest Tests DatabaseStorage operations.