You are here

protected function MigrateViewModesTest::assertEntity in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/field/src/Tests/Migrate/d7/MigrateViewModesTest.php \Drupal\field\Tests\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.

bool $status: The expected status of the view mode.

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

File

core/modules/field/src/Tests/Migrate/d7/MigrateViewModesTest.php, line 45
Contains \Drupal\field\Tests\Migrate\d7\MigrateViewModesTest.

Class

MigrateViewModesTest
Tests migration of D7 view modes.

Namespace

Drupal\field\Tests\Migrate\d7

Code

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

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