ConfigDependencyManagerTest.php
Same filename in this branch
Same filename in other branches
- 9 core/tests/Drupal/Tests/Core/Config/ConfigDependencyManagerTest.php
- 9 core/tests/Drupal/Tests/Core/Config/Entity/ConfigDependencyManagerTest.php
- 8.9.x core/tests/Drupal/Tests/Core/Config/ConfigDependencyManagerTest.php
- 8.9.x core/tests/Drupal/Tests/Core/Config/Entity/ConfigDependencyManagerTest.php
- 10 core/tests/Drupal/Tests/Core/Config/ConfigDependencyManagerTest.php
- 10 core/tests/Drupal/Tests/Core/Config/Entity/ConfigDependencyManagerTest.php
Namespace
Drupal\Tests\Core\ConfigFile
-
core/
tests/ Drupal/ Tests/ Core/ Config/ ConfigDependencyManagerTest.php
View source
<?php
declare (strict_types=1);
namespace Drupal\Tests\Core\Config;
use Drupal\Core\Config\Entity\ConfigDependencyManager;
use Drupal\Tests\UnitTestCase;
/**
* Tests the ConfigDependencyManager class.
*
* @group Config
*
* @coversDefaultClass \Drupal\Core\Config\Entity\ConfigDependencyManager
*/
class ConfigDependencyManagerTest extends UnitTestCase {
/**
* @dataProvider providerTestSortAll
*/
public function testSortAll(array $data, array $expected_order) : void {
$dependency_manager = new ConfigDependencyManager();
$dependency_manager->setData($data);
$this->assertEquals($expected_order, $dependency_manager->sortAll());
}
public static function providerTestSortAll() {
$datasets[] = [
[
'provider.entity_b' => [],
'provider.entity_a' => [],
],
[
'provider.entity_a',
'provider.entity_b',
],
];
$datasets[] = [
[
'provider.entity_a' => [],
'provider.entity_b' => [],
],
[
'provider.entity_a',
'provider.entity_b',
],
];
$datasets[] = [
[
'provider.entity_b' => [
'dependencies' => [
'config' => [
'provider.entity_a',
],
],
],
'provider.entity_a' => [],
],
[
'provider.entity_a',
'provider.entity_b',
],
];
$datasets[] = [
[
'provider.entity_a' => [],
'provider.entity_b' => [
'dependencies' => [
'config' => [
'provider.entity_a',
],
],
],
],
[
'provider.entity_a',
'provider.entity_b',
],
];
$datasets[] = [
[
'provider.entity_b' => [],
'provider.entity_a' => [
'dependencies' => [
'config' => [
'provider.entity_b',
],
],
],
],
[
'provider.entity_b',
'provider.entity_a',
],
];
$datasets[] = [
[
'provider.entity_a' => [
'dependencies' => [
'config' => [
'provider.entity_b',
],
],
],
'provider.entity_b' => [],
],
[
'provider.entity_b',
'provider.entity_a',
],
];
$datasets[] = [
[
'provider.entity_a' => [
'dependencies' => [
'config' => [
'provider.entity_b',
],
],
],
'provider.entity_b' => [],
'block.block.a' => [],
'block.block.b' => [],
],
[
'block.block.a',
'provider.entity_b',
'block.block.b',
'provider.entity_a',
],
];
$datasets[] = [
[
'provider.entity_b' => [],
'block.block.b' => [],
'block.block.a' => [],
'provider.entity_a' => [
'dependencies' => [
'config' => [
'provider.entity_b',
],
],
],
],
[
'block.block.a',
'provider.entity_b',
'block.block.b',
'provider.entity_a',
],
];
$datasets[] = [
[
'provider.entity_b' => [],
'block.block.b' => [],
'block.block.a' => [],
'provider.entity_a' => [
'dependencies' => [
'config' => [
'provider.entity_b',
],
],
],
'provider.entity_c' => [
'dependencies' => [
'config' => [
'block.block.a',
],
],
],
],
[
'block.block.a',
'block.block.b',
'provider.entity_b',
'provider.entity_a',
'provider.entity_c',
],
];
$datasets[] = [
[
'provider.entity_b' => [
'dependencies' => [
'module' => [
'system',
],
],
],
'block.block.b' => [],
'block.block.a' => [
'dependencies' => [
'module' => [
'system',
],
],
],
'provider.entity_a' => [
'dependencies' => [
'config' => [
'provider.entity_c',
],
],
],
'provider.entity_c' => [
'dependencies' => [
'config' => [
'block.block.a',
],
],
],
],
[
'block.block.b',
'block.block.a',
'provider.entity_c',
'provider.entity_a',
'provider.entity_b',
],
];
return $datasets;
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
ConfigDependencyManagerTest | Tests the ConfigDependencyManager class. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.