function ConfigEntityBaseUnitTest::providerCalculateDependenciesWithPluginCollections

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityBaseUnitTest::providerCalculateDependenciesWithPluginCollections()
  2. 10 core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityBaseUnitTest::providerCalculateDependenciesWithPluginCollections()
  3. 11.x core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityBaseUnitTest::providerCalculateDependenciesWithPluginCollections()

Data provider for testCalculateDependenciesWithPluginCollections.

Return value

array

File

core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php, line 289

Class

ConfigEntityBaseUnitTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Config%21Entity%21ConfigEntityBase.php/class/ConfigEntityBase/8.9.x" title="Defines a base configuration entity class." class="local">\Drupal\Core\Config\Entity\ConfigEntityBase</a> @group Config

Namespace

Drupal\Tests\Core\Config\Entity

Code

public function providerCalculateDependenciesWithPluginCollections() {
    // Start with 'a' so that order of the dependency array is fixed.
    $instance_dependency_1 = 'a' . $this->randomMachineName(10);
    $instance_dependency_2 = 'a' . $this->randomMachineName(11);
    return [
        // Tests that the plugin provider is a module dependency.
[
            [
                'provider' => 'test',
            ],
            [
                'module' => [
                    'test',
                ],
            ],
        ],
        // Tests that the plugin provider is a theme dependency.
[
            [
                'provider' => 'test_theme',
            ],
            [
                'theme' => [
                    'test_theme',
                ],
            ],
        ],
        // Tests that a plugin that is provided by the same module as the config
        // entity is not added to the dependencies array.
[
            [
                'provider' => $this->provider,
            ],
            [],
        ],
        // Tests that a config entity that has a plugin which provides config
        // dependencies in its definition has them.
[
            [
                'provider' => 'test',
                'config_dependencies' => [
                    'config' => [
                        $instance_dependency_1,
                    ],
                    'module' => [
                        $instance_dependency_2,
                    ],
                ],
            ],
            [
                'config' => [
                    $instance_dependency_1,
                ],
                'module' => [
                    $instance_dependency_2,
                    'test',
                ],
            ],
        ],
    ];
}

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