MemoryStorageTest.php

Same filename in this branch
  1. 11.x core/tests/Drupal/KernelTests/Core/KeyValueStore/MemoryStorageTest.php
Same filename in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Config/Storage/MemoryStorageTest.php
  2. 9 core/tests/Drupal/KernelTests/Core/KeyValueStore/MemoryStorageTest.php
  3. 8.9.x core/tests/Drupal/KernelTests/Core/Config/Storage/MemoryStorageTest.php
  4. 8.9.x core/tests/Drupal/KernelTests/Core/KeyValueStore/MemoryStorageTest.php
  5. 10 core/tests/Drupal/KernelTests/Core/Config/Storage/MemoryStorageTest.php
  6. 10 core/tests/Drupal/KernelTests/Core/KeyValueStore/MemoryStorageTest.php

Namespace

Drupal\KernelTests\Core\Config\Storage

File

core/tests/Drupal/KernelTests/Core/Config/Storage/MemoryStorageTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\KernelTests\Core\Config\Storage;

use Drupal\Core\Config\MemoryStorage;

/**
 * Tests MemoryStorage operations.
 *
 * @group config
 */
class MemoryStorageTest extends ConfigStorageTestBase {
    
    /**
     * {@inheritdoc}
     */
    protected function setUp() : void {
        parent::setUp();
        $this->storage = new MemoryStorage();
    }
    
    /**
     * {@inheritdoc}
     */
    protected function read($name) {
        return $this->storage
            ->read($name);
    }
    
    /**
     * {@inheritdoc}
     */
    protected function insert($name, $data) : void {
        $this->storage
            ->write($name, $data);
    }
    
    /**
     * {@inheritdoc}
     */
    protected function update($name, $data) : void {
        $this->storage
            ->write($name, $data);
    }
    
    /**
     * {@inheritdoc}
     */
    protected function delete($name) : void {
        $this->storage
            ->delete($name);
    }
    
    /**
     * {@inheritdoc}
     */
    public function testInvalidStorage() : void {
        $this->markTestSkipped('MemoryStorage cannot be invalid.');
    }

}

Classes

Title Deprecated Summary
MemoryStorageTest Tests MemoryStorage operations.

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