function UserLegacyTest::testUserView
@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\KernelCode
public function testUserView() {
$entity = User::create();
$this->assertNotEmpty(user_view($entity));
$entities = [
User::create(),
User::create(),
];
$this->assertCount(4, user_view_multiple($entities));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.