You are here

protected function ContentTranslationSyncImageTest::saveEntity in Drupal 8

Same name and namespace 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()

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