function ConfigEntityDependencyTest::testEmptyDependencies

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityDependencyTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityDependencyTest::testEmptyDependencies()
  2. 8.9.x core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityDependencyTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityDependencyTest::testEmptyDependencies()
  3. 11.x core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityDependencyTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityDependencyTest::testEmptyDependencies()

File

core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityDependencyTest.php, line 17

Class

ConfigEntityDependencyTest
Tests the ConfigEntityDependency class.

Namespace

Drupal\Tests\Core\Config\Entity

Code

public function testEmptyDependencies() : void {
    $dep = new ConfigEntityDependency('config_test.dynamic.entity_id', []);
    $this->assertEquals('config_test.dynamic.entity_id', $dep->getConfigDependencyName());
    $this->assertEquals([], $dep->getDependencies('theme'));
    $this->assertEquals([], $dep->getDependencies('config'));
    $this->assertEquals([
        'config_test',
    ], $dep->getDependencies('module'));
    $this->assertTrue($dep->hasDependency('module', 'config_test'));
    $this->assertFalse($dep->hasDependency('module', 'views'));
}

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