public function ConfigEntityBaseUnitTest::testCalculateDependencies in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityBaseUnitTest::testCalculateDependencies()
@covers ::calculateDependencies @covers ::getDependencies
File
- core/
tests/ Drupal/ Tests/ Core/ Config/ Entity/ ConfigEntityBaseUnitTest.php, line 144 - Contains \Drupal\Tests\Core\Config\Entity\ConfigEntityBaseUnitTest.
Class
- ConfigEntityBaseUnitTest
- @coversDefaultClass \Drupal\Core\Config\Entity\ConfigEntityBase @group Config
Namespace
Drupal\Tests\Core\Config\EntityCode
public function testCalculateDependencies() {
// Calculating dependencies will reset the dependencies array.
$this->entity
->set('dependencies', array(
'module' => array(
'node',
),
));
$this
->assertEmpty($this->entity
->calculateDependencies()
->getDependencies());
// Calculating dependencies will reset the dependencies array using enforced
// dependencies.
$this->entity
->set('dependencies', array(
'module' => array(
'node',
),
'enforced' => array(
'module' => 'views',
),
));
$dependencies = $this->entity
->calculateDependencies()
->getDependencies();
$this
->assertContains('views', $dependencies['module']);
$this
->assertNotContains('node', $dependencies['module']);
}