You are here

protected function MigrateViewModesTest::assertEntity in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/field/tests/src/Kernel/Migrate/d7/MigrateViewModesTest.php \Drupal\Tests\field\Kernel\Migrate\d7\MigrateViewModesTest::assertEntity()

Asserts various aspects of a view mode entity.

Parameters

string $id: The entity ID.

string $label: The expected label of the view mode.

string $entity_type: The expected entity type ID which owns the view mode.

1 call to MigrateViewModesTest::assertEntity()
MigrateViewModesTest::testMigration in core/modules/field/tests/src/Kernel/Migrate/d7/MigrateViewModesTest.php
Tests migration of D7 view mode variables to D8 config entities.

File

core/modules/field/tests/src/Kernel/Migrate/d7/MigrateViewModesTest.php, line 38

Class

MigrateViewModesTest
Tests migration of D7 view modes.

Namespace

Drupal\Tests\field\Kernel\Migrate\d7

Code

protected function assertEntity($id, $label, $entity_type) {

  /** @var \Drupal\Core\Entity\EntityViewModeInterface $view_mode */
  $view_mode = EntityViewMode::load($id);
  $this
    ->assertInstanceOf(EntityViewModeInterface::class, $view_mode);
  $this
    ->assertIdentical($label, $view_mode
    ->label());
  $this
    ->assertIdentical($entity_type, $view_mode
    ->getTargetType());
}