You are here

public function NodeCommentsTest::testNewComments in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/comment/src/Tests/Views/NodeCommentsTest.php \Drupal\comment\Tests\Views\NodeCommentsTest::testNewComments()

Test the new comments field plugin.

File

core/modules/comment/src/Tests/Views/NodeCommentsTest.php, line 34
Contains \Drupal\comment\Tests\Views\NodeCommentsTest.

Class

NodeCommentsTest
Tests comments on nodes.

Namespace

Drupal\comment\Tests\Views

Code

public function testNewComments() {
  $this
    ->drupalGet('test-new-comments');
  $this
    ->assertResponse(200);
  $new_comments = $this
    ->cssSelect(".views-field-new-comments a:contains('1')");
  $this
    ->assertEqual(count($new_comments), 1, 'Found the number of new comments for a certain node.');
}