function ContentTranslationEntityBundleInfoTest::testBundleClearOnLanguageContentSettingUpdate
Same name in other branches
- 8.9.x core/modules/content_translation/tests/src/Kernel/ContentTranslationEntityBundleInfoTest.php \Drupal\Tests\content_translation\Kernel\ContentTranslationEntityBundleInfoTest::testBundleClearOnLanguageContentSettingUpdate()
- 10 core/modules/content_translation/tests/src/Kernel/ContentTranslationEntityBundleInfoTest.php \Drupal\Tests\content_translation\Kernel\ContentTranslationEntityBundleInfoTest::testBundleClearOnLanguageContentSettingUpdate()
- 11.x core/modules/content_translation/tests/src/Kernel/ContentTranslationEntityBundleInfoTest.php \Drupal\Tests\content_translation\Kernel\ContentTranslationEntityBundleInfoTest::testBundleClearOnLanguageContentSettingUpdate()
Tests that bundle translation setting changes are propagated.
Throws
\Drupal\Core\Entity\EntityStorageException
\Exception
File
-
core/
modules/ content_translation/ tests/ src/ Kernel/ ContentTranslationEntityBundleInfoTest.php, line 118
Class
- ContentTranslationEntityBundleInfoTest
- Tests the Content Translation bundle info logic.
Namespace
Drupal\Tests\content_translation\KernelCode
public function testBundleClearOnLanguageContentSettingUpdate() {
$node = $this->getBundledNode();
$this->assertFalse($node->isTranslatable());
$this->container
->get('entity_type.manager')
->getStorage('language_content_settings')
->create([
'target_entity_type_id' => 'node',
'target_bundle' => 'bundle_test',
])
->save();
$this->assertFalse($node->isTranslatable());
$this->contentTranslationManager
->setEnabled('node', 'bundle_test', TRUE);
$this->assertTrue($node->isTranslatable(), "Bundle info was not cleared on language_content_settings update.");
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.