You are here

protected function ContentTranslationFieldSyncRevisionTest::setUntranslatableFieldWidgetsDisplay in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/content_translation/tests/src/Kernel/ContentTranslationFieldSyncRevisionTest.php \Drupal\Tests\content_translation\Kernel\ContentTranslationFieldSyncRevisionTest::setUntranslatableFieldWidgetsDisplay()
  2. 10 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
Test 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 392

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();
}