// Verify that this user can edit forum content authored by another user.
$this->
verifyForums($own_topics_user_node, TRUE
);
// Verify the topic and post counts on the forum page.
$this->
drupalGet('forum'
);
// Find the table row for the forum that has new posts. This cannot be
// reliably identified by any CSS selector or its position in the table,
// so look for an element with the "New posts" title and traverse up the
// document tree until we get to the table row that contains it.
$row =
$this->
assertSession()->
elementExists('css', '[title="New posts"]'
);
while ($row &&
$row->
getTagName() !== 'tr'
) { $row =
$row->
getParent();
} $this->
assertNotEmpty($row);
$cells =
$row->
findAll('css', 'td'
);
$this->
assertCount(4,
$cells);
// Topics cell contains number of topics (6), number of unread topics (also
// 6), and the forum name.
$this->
assertEquals('6 6 new posts in forum ' .
$this->forum
['name'
],
$cells[1
]->
getText(), 'Number of topics found.'
);
// Verify total number of posts in forum.