function NodeCommentsTest::testNewComments
Tests the new comments field plugin.
File
- 
              core/
modules/ comment/ tests/ src/ Functional/ Views/ NodeCommentsTest.php, line 34  
Class
- NodeCommentsTest
 - Tests comments on nodes.
 
Namespace
Drupal\Tests\comment\Functional\ViewsCode
public function testNewComments() {
  $this->drupalGet('test-new-comments');
  $this->assertSession()
    ->statusCodeEquals(200);
  $new_comments = $this->cssSelect(".views-field-new-comments a:contains('1')");
  $this->assertCount(1, $new_comments, 'Found the number of new comments for a certain node.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.