Tests the block defined by the comments_recent view.
public function testBlockDisplay() {
$view = views_get_view('comments_recent');
$view
->setDisplay('block');
$this
->executeView($view);
$map = array(
'comment_nid' => 'nid',
'comment_subject' => 'subject',
'cid' => 'cid',
'comment_changed' => 'changed',
);
$expected_result = array();
foreach (array_values($this->commentsCreated) as $key => $comment) {
$expected_result[$key]['nid'] = $comment->nid;
$expected_result[$key]['subject'] = $comment->subject;
$expected_result[$key]['cid'] = $comment->cid;
$expected_result[$key]['changed'] = $comment->changed;
}
$this
->assertIdenticalResultset($view, $expected_result, $map);
// Check the number of results given by the display is the expected.
$this
->assertEqual(sizeof($view->result), $this->blockDisplayResults, format_string('There are exactly @results comments. Expected @expected', array(
'@results' => count($view->result),
'@expected' => $this->blockDisplayResults,
)));
}