function EntityDisplayModeBaseUnitTest::testCalculateDependencies
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayModeBaseUnitTest.php \Drupal\Tests\Core\Config\Entity\EntityDisplayModeBaseUnitTest::testCalculateDependencies()
- 10 core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayModeBaseUnitTest.php \Drupal\Tests\Core\Config\Entity\EntityDisplayModeBaseUnitTest::testCalculateDependencies()
- 11.x core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayModeBaseUnitTest.php \Drupal\Tests\Core\Config\Entity\EntityDisplayModeBaseUnitTest::testCalculateDependencies()
@covers ::calculateDependencies
File
-
core/
tests/ Drupal/ Tests/ Core/ Config/ Entity/ EntityDisplayModeBaseUnitTest.php, line 75
Class
- EntityDisplayModeBaseUnitTest
- @coversDefaultClass \Drupal\Core\Entity\EntityDisplayModeBase @group Config
Namespace
Drupal\Tests\Core\Config\EntityCode
public function testCalculateDependencies() {
$target_entity_type_id = $this->randomMachineName(16);
$target_entity_type = $this->createMock('\\Drupal\\Core\\Entity\\EntityTypeInterface');
$target_entity_type->expects($this->any())
->method('getProvider')
->willReturn('test_module');
$values = [
'targetEntityType' => $target_entity_type_id,
];
$this->entityTypeManager
->expects($this->exactly(2))
->method('getDefinition')
->willReturnMap([
[
$target_entity_type_id,
TRUE,
$target_entity_type,
],
[
$this->entityType,
TRUE,
$this->entityInfo,
],
]);
$this->entity = $this->getMockBuilder('\\Drupal\\Core\\Entity\\EntityDisplayModeBase')
->setConstructorArgs([
$values,
$this->entityType,
])
->addMethods([
'getFilterFormat',
])
->getMock();
$dependencies = $this->entity
->calculateDependencies()
->getDependencies();
$this->assertContains('test_module', $dependencies['module']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.