function ContentTranslationSyncImageTest::saveEntity

Same name in other branches
  1. 9 core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php \Drupal\Tests\content_translation\Functional\ContentTranslationSyncImageTest::saveEntity()
  2. 10 core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php \Drupal\Tests\content_translation\Functional\ContentTranslationSyncImageTest::saveEntity()
  3. 11.x core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php \Drupal\Tests\content_translation\Functional\ContentTranslationSyncImageTest::saveEntity()

Saves the passed entity and reloads it, enabling compatibility mode.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity to be saved.

Return value

\Drupal\Core\Entity\EntityInterface The saved entity.

1 call to ContentTranslationSyncImageTest::saveEntity()
ContentTranslationSyncImageTest::testImageFieldSync in core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php
Tests image field field synchronization.

File

core/modules/content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php, line 261

Class

ContentTranslationSyncImageTest
Tests the field synchronization behavior for the image field.

Namespace

Drupal\Tests\content_translation\Functional

Code

protected function saveEntity(EntityInterface $entity) {
    $entity->save();
    $entity = \Drupal::entityTypeManager()->getStorage('entity_test_mul')
        ->loadUnchanged($entity->id());
    return $entity;
}

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