You are here

public function UserLegacyTest::testUserView in Drupal 8

@expectedDeprecation user_view() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal::entityTypeManager()->getViewBuilder('user')->view() instead. See https://www.drupal.org/node/3033656 @expectedDeprecation user_view_multiple() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal::entityTypeManager()->getViewBuilder('user')->viewMultiple() instead. See https://www.drupal.org/node/3033656

File

core/modules/user/tests/src/Kernel/UserLegacyTest.php, line 53

Class

UserLegacyTest
Tests legacy user functionality.

Namespace

Drupal\Tests\user\Kernel

Code

public function testUserView() {
  $entity = User::create();
  $this
    ->assertNotEmpty(user_view($entity));
  $entities = [
    User::create(),
    User::create(),
  ];
  $this
    ->assertCount(4, user_view_multiple($entities));
}