You are here

public function ConfigEntityBaseUnitTest::providerCalculateDependenciesWithPluginCollections in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 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 256
Contains \Drupal\Tests\Core\Config\Entity\ConfigEntityBaseUnitTest.

Class

ConfigEntityBaseUnitTest
@coversDefaultClass \Drupal\Core\Config\Entity\ConfigEntityBase @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 array(
    // Tests that the plugin provider is a module dependency.
    array(
      array(
        'provider' => 'test',
      ),
      array(
        'module' => array(
          'test',
        ),
      ),
    ),
    // Tests that a plugin that is provided by the same module as the config
    // entity is not added to the dependencies array.
    array(
      array(
        'provider' => $this->provider,
      ),
      array(
        'module' => array(
          NULL,
        ),
      ),
    ),
    // Tests that a config entity that has a plugin which provides config
    // dependencies in its definition has them.
    array(
      array(
        'provider' => 'test',
        'config_dependencies' => array(
          'config' => array(
            $instance_dependency_1,
          ),
          'module' => array(
            $instance_dependency_2,
          ),
        ),
      ),
      array(
        'config' => array(
          $instance_dependency_1,
        ),
        'module' => array(
          $instance_dependency_2,
          'test',
        ),
      ),
    ),
  );
}