function ContentTranslationFieldSyncRevisionTest::setUntranslatableFieldWidgetsDisplay

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

Sets untranslatable field widgets' display status.

Parameters

bool $display: Whether untranslatable field widgets should be displayed.

2 calls to ContentTranslationFieldSyncRevisionTest::setUntranslatableFieldWidgetsDisplay()
ContentTranslationFieldSyncRevisionTest::testChangeDefaultLanguageNonTranslatableFieldsHidden in core/modules/content_translation/tests/src/Kernel/ContentTranslationFieldSyncRevisionTest.php
Tests changing the default language of an entity.
ContentTranslationFieldSyncRevisionTest::testFieldSynchronizationAndValidation in core/modules/content_translation/tests/src/Kernel/ContentTranslationFieldSyncRevisionTest.php
Checks that field synchronization works as expected with revisions.

File

core/modules/content_translation/tests/src/Kernel/ContentTranslationFieldSyncRevisionTest.php, line 472

Class

ContentTranslationFieldSyncRevisionTest
Tests the field synchronization logic when revisions are involved.

Namespace

Drupal\Tests\content_translation\Kernel

Code

protected function setUntranslatableFieldWidgetsDisplay($display) {
    $entity_type_id = $this->storage
        ->getEntityTypeId();
    $settings = [
        'untranslatable_fields_hide' => !$display,
    ];
    $this->contentTranslationManager
        ->setBundleTranslationSettings($entity_type_id, $entity_type_id, $settings);
    
    /** @var \Drupal\Core\Entity\EntityTypeBundleInfo $bundle_info */
    $bundle_info = $this->container
        ->get('entity_type.bundle.info');
    $bundle_info->clearCachedBundles();
}

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