function CommentLegacyTest::testCommentView
@expectedDeprecation comment_view() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal::entityTypeManager()->getViewBuilder('comment')->view() instead. See https://www.drupal.org/node/3033656 @expectedDeprecation comment_view_multiple() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal::entityTypeManager()->getViewBuilder('comment')->viewMultiple() instead. See https://www.drupal.org/node/3033656
File
-
core/
modules/ comment/ tests/ src/ Kernel/ CommentLegacyTest.php, line 84
Class
- CommentLegacyTest
- Tests legacy comment functionality.
Namespace
Drupal\Tests\comment\KernelCode
public function testCommentView() {
$entity = $this->createComment();
$this->assertNotEmpty(comment_view($entity));
$entities = [
$this->createComment(),
$this->createComment(),
];
$this->assertCount(4, comment_view_multiple($entities));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.