function ContentTranslationEntityBundleInfoTest::testFieldSynchronizationWithDisabledBundle

Same name in other branches
  1. 9 core/modules/content_translation/tests/src/Kernel/ContentTranslationEntityBundleInfoTest.php \Drupal\Tests\content_translation\Kernel\ContentTranslationEntityBundleInfoTest::testFieldSynchronizationWithDisabledBundle()
  2. 8.9.x core/modules/content_translation/tests/src/Kernel/ContentTranslationEntityBundleInfoTest.php \Drupal\Tests\content_translation\Kernel\ContentTranslationEntityBundleInfoTest::testFieldSynchronizationWithDisabledBundle()
  3. 11.x core/modules/content_translation/tests/src/Kernel/ContentTranslationEntityBundleInfoTest.php \Drupal\Tests\content_translation\Kernel\ContentTranslationEntityBundleInfoTest::testFieldSynchronizationWithDisabledBundle()

Tests that field synchronization is skipped for disabled bundles.

File

core/modules/content_translation/tests/src/Kernel/ContentTranslationEntityBundleInfoTest.php, line 91

Class

ContentTranslationEntityBundleInfoTest
Tests the Content Translation bundle info logic.

Namespace

Drupal\Tests\content_translation\Kernel

Code

public function testFieldSynchronizationWithDisabledBundle() : void {
    $entity = EntityTestMul::create();
    $entity->save();
    
    /** @var \Drupal\Core\Entity\ContentEntityInterface $translation */
    $translation = $entity->addTranslation('it');
    $translation->save();
    $this->assertTrue($entity->isTranslatable());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.