function CommentStatisticsUnitTest::testRead

Same name and namespace in other branches
  1. 9 core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php \Drupal\Tests\comment\Unit\CommentStatisticsUnitTest::testRead()
  2. 8.9.x core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php \Drupal\Tests\comment\Unit\CommentStatisticsUnitTest::testRead()
  3. 11.x core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php \Drupal\Tests\comment\Unit\CommentStatisticsUnitTest::testRead()

Tests the read method.

@group Drupal @group Comment

See also

\Drupal\comment\CommentStatistics::read()

File

core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php, line 102

Class

CommentStatisticsUnitTest
@coversDefaultClass \Drupal\comment\CommentStatistics[[api-linebreak]] @group comment

Namespace

Drupal\Tests\comment\Unit

Code

public function testRead() : void {
  $this->callsToFetch = 0;
  $results = $this->commentStatistics
    ->read([
    '1' => 'boo',
    '2' => 'foo',
  ], 'snafus');
  $this->assertEquals([
    'something',
    'something-else',
  ], $results);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.