
| Current Path : /var/www/html/strat/web/core/tests/Drupal/KernelTests/Core/Config/Storage/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/strat/web/core/tests/Drupal/KernelTests/Core/Config/Storage/ManagedStorageTest.php |
<?php
declare(strict_types=1);
namespace Drupal\KernelTests\Core\Config\Storage;
use Drupal\Core\Config\StorageManagerInterface;
use Drupal\Core\Config\ManagedStorage;
use Drupal\Core\Config\MemoryStorage;
/**
* Tests ManagedStorage operations.
*
* @group config
*/
class ManagedStorageTest extends ConfigStorageTestBase implements StorageManagerInterface {
/**
* {@inheritdoc}
*/
public function getStorage() {
// We return a new storage every time to make sure the managed storage
// only calls this once and retains the configuration by itself.
return new MemoryStorage();
}
/**
* {@inheritdoc}
*/
protected function setUp(): void {
parent::setUp();
$this->storage = new ManagedStorage($this);
}
/**
* {@inheritdoc}
*/
protected function read($name) {
return $this->storage->read($name);
}
/**
* {@inheritdoc}
*/
protected function insert($name, $data) {
$this->storage->write($name, $data);
}
/**
* {@inheritdoc}
*/
protected function update($name, $data) {
$this->storage->write($name, $data);
}
/**
* {@inheritdoc}
*/
protected function delete($name) {
$this->storage->delete($name);
}
/**
* {@inheritdoc}
*/
public function testInvalidStorage(): void {
$this->markTestSkipped('ManagedStorage cannot be invalid.');
}
}