本文整理匯總了PHP中Drupal\language\Entity\ContentLanguageSettings::calculateDependencies方法的典型用法代碼示例。如果您正苦於以下問題:PHP ContentLanguageSettings::calculateDependencies方法的具體用法?PHP ContentLanguageSettings::calculateDependencies怎麽用?PHP ContentLanguageSettings::calculateDependencies使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Drupal\language\Entity\ContentLanguageSettings
的用法示例。
在下文中一共展示了ContentLanguageSettings::calculateDependencies方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testCalculateDependencies
/**
* @covers ::calculateDependencies
*/
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']);
}