protected function assertEntity(string
$id, string
$label, string
$entity_type): void
{ /** @var \Drupal\Core\Entity\EntityViewModeInterface $view_mode */
$view_mode = EntityViewMode::
load($id);
$this->
assertInstanceOf(EntityViewModeInterface::
class,
$view_mode);
$this->
assertSame($label,
$view_mode->
label());
$this->
assertSame($entity_type,
$view_mode->
getTargetType());
} /**
* Tests migration of D7 view mode variables to D8 config entities.
*/
public function testMigration() { $this->
assertEntity('comment.full', 'Full', 'comment'
);
$this->
assertEntity('node.teaser', 'Teaser', 'node'
);
$this->
assertEntity('node.full', 'Full', 'node'
);
$this->
assertEntity('node.custom', 'custom', 'node'
);
$this->
assertEntity('user.full', 'Full', 'user'
);
}