function CheckpointStorageTest::testWriteOperations

@covers ::write @covers ::delete @covers ::rename @covers ::deleteAll

@dataProvider writeMethodsProvider

File

core/tests/Drupal/Tests/Core/Config/Checkpoint/CheckpointStorageTest.php, line 163

Class

CheckpointStorageTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Config%21Checkpoint%21CheckpointStorage.php/class/CheckpointStorage/11.x" title="Provides a config storage that can make checkpoints." class="local">\Drupal\Core\Config\Checkpoint\CheckpointStorage</a> @group Config

Namespace

Drupal\Tests\Core\Config\Checkpoint

Code

public function testWriteOperations(string $method, array $arguments, array $fixture) : void {
    $this->setRandomFixtureConfig($fixture);
    // Create an independent memory storage as a backup.
    $backup = new MemoryStorage();
    static::replaceStorageContents($this->memory, $backup);
    try {
        call_user_func_array([
            $this->storage,
            $method,
        ], $arguments);
        $this->fail("exception not thrown");
    } catch (\BadMethodCallException $exception) {
        $this->assertEquals(CheckpointStorage::class . '::' . $method . ' is not allowed on a CheckpointStorage', $exception->getMessage());
    }
    // Assert that the memory storage has not been altered.
    $this->assertEquals($backup, $this->memory);
}

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