Tests the comment pager for nodes with multiple grants per realm.
public function testCommentPager() {
// Create a node.
$node = $this
->drupalCreateNode();
// Create 60 comments.
for ($i = 0; $i < 60; $i++) {
$comment = entity_create('comment', array(
'nid' => $node->nid,
'node_type' => 'node_type_' . $node
->bundle(),
'subject' => $this
->randomName(),
'comment_body' => array(
array(
'value' => $this
->randomName(),
),
),
));
$comment
->save();
}
$this
->drupalLogin($this->web_user);
// View the node page. With the default 50 comments per page there should
// be two pages (0, 1) but no third (2) page.
$this
->drupalGet('node/' . $node->nid);
$this
->assertText($node
->label());
$this
->assertText(t('Comments'));
$this
->assertRaw('page=1');
$this
->assertNoRaw('page=2');
}