public function ContentLanguageSettingsUnitTest::testCalculateDependencies in Zircon Profile 8
Same name and namespace in other branches
- 8.0 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 89 - Contains \Drupal\Tests\language\Unit\ContentLanguageSettingsUnitTest.
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
->getMock('\\Drupal\\Core\\Entity\\EntityTypeInterface');
$target_entity_type
->expects($this
->any())
->method('getBundleConfigDependency')
->will($this
->returnValue(array(
'type' => 'config',
'name' => 'test.test_entity_type.id',
)));
$this->entityManager
->expects($this
->any())
->method('getDefinition')
->with('test_entity_type')
->will($this
->returnValue($target_entity_type));
$config = new ContentLanguageSettings(array(
'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']);
}