function ReadOnlyStorageTest::writeMethodsProvider

Same name and namespace in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Config/ReadOnlyStorageTest.php \Drupal\Tests\Core\Config\ReadOnlyStorageTest::writeMethodsProvider()
  2. 10 core/tests/Drupal/Tests/Core/Config/ReadOnlyStorageTest.php \Drupal\Tests\Core\Config\ReadOnlyStorageTest::writeMethodsProvider()
  3. 11.x core/tests/Drupal/Tests/Core/Config/ReadOnlyStorageTest.php \Drupal\Tests\Core\Config\ReadOnlyStorageTest::writeMethodsProvider()

Provide the methods that throw an exception.

Return value

array The data

File

core/tests/Drupal/Tests/Core/Config/ReadOnlyStorageTest.php, line 116

Class

ReadOnlyStorageTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Config%21ReadOnlyStorage.php/class/ReadOnlyStorage/9" title="A ReadOnlyStorage decorates a storage and does not allow writing to it." class="local">\Drupal\Core\Config\ReadOnlyStorage</a> @group Config

Namespace

Drupal\Tests\Core\Config

Code

public function writeMethodsProvider() {
    $fixture = [
        StorageInterface::DEFAULT_COLLECTION => [
            'config.a',
            'config.b',
        ],
    ];
    $data = [];
    $data[] = [
        'write',
        [
            'config.a',
            (array) $this->getRandomGenerator()
                ->object(),
        ],
        $fixture,
    ];
    $data[] = [
        'write',
        [
            $this->randomMachineName(),
            (array) $this->getRandomGenerator()
                ->object(),
        ],
        $fixture,
    ];
    $data[] = [
        'delete',
        [
            'config.a',
        ],
        $fixture,
    ];
    $data[] = [
        'delete',
        [
            $this->randomMachineName(),
        ],
        $fixture,
    ];
    $data[] = [
        'rename',
        [
            'config.a',
            'config.b',
        ],
        $fixture,
    ];
    $data[] = [
        'rename',
        [
            'config.a',
            $this->randomMachineName(),
        ],
        $fixture,
    ];
    $data[] = [
        'rename',
        [
            $this->randomMachineName(),
            $this->randomMachineName(),
        ],
        $fixture,
    ];
    $data[] = [
        'deleteAll',
        [
            '',
        ],
        $fixture,
    ];
    $data[] = [
        'deleteAll',
        [
            'config',
        ],
        $fixture,
    ];
    $data[] = [
        'deleteAll',
        [
            'other',
        ],
        $fixture,
    ];
    return $data;
}

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