function ContentLanguageSettingsUnitTest::testCalculateDependencies
Same name in other branches
- 9 core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php \Drupal\Tests\language\Unit\ContentLanguageSettingsUnitTest::testCalculateDependencies()
- 10 core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php \Drupal\Tests\language\Unit\ContentLanguageSettingsUnitTest::testCalculateDependencies()
- 11.x core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php \Drupal\Tests\language\Unit\ContentLanguageSettingsUnitTest::testCalculateDependencies()
@covers ::calculateDependencies
File
-
core/
modules/ language/ tests/ src/ Unit/ ContentLanguageSettingsUnitTest.php, line 86
Class
- ContentLanguageSettingsUnitTest
- @coversDefaultClass \Drupal\language\Entity\ContentLanguageSettings @group language
Namespace
Drupal\Tests\language\UnitCode
public function testCalculateDependencies() {
// Mock the interfaces necessary to create a dependency on a bundle entity.
$target_entity_type = $this->createMock('\\Drupal\\Core\\Entity\\EntityTypeInterface');
$target_entity_type->expects($this->any())
->method('getBundleConfigDependency')
->will($this->returnValue([
'type' => 'config',
'name' => 'test.test_entity_type.id',
]));
$this->entityTypeManager
->expects($this->any())
->method('getDefinition')
->with('test_entity_type')
->will($this->returnValue($target_entity_type));
$config = new ContentLanguageSettings([
'target_entity_type_id' => 'test_entity_type',
'target_bundle' => 'test_bundle',
], 'language_content_settings');
$dependencies = $config->calculateDependencies()
->getDependencies();
$this->assertContains('test.test_entity_type.id', $dependencies['config']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.