$status=(bool)db_query_range("SELECT 1 FROM {watchdog} WHERE message = :message AND variables = :variables",0,1,array(':message'=>$watchdog_message,':variables'=>serialize($variables)))->fetchField();
$this->setCommentAnonymous('0');// Ensure that doesn't require contact info.
// Test that the comments page loads correctly when there are no comments
$this->drupalGet('admin/content/comment');
$this->assertText(t('No comments available.'));
$this->drupalLogout();
// Post anonymous comment without contact info.
$subject=$this->randomName();
$body=$this->randomName();
$this->postComment($this->node,$body,$subject,TRUE);// Set $contact to true so that it won't check for id and message.
$this->assertText(t('Your comment has been queued for review by site administrators and will be published after approval.'),t('Comment requires approval.'));
$this->setCommentAnonymous('0');// Ensure that doesn't require contact info.
$this->drupalLogout();
// Post anonymous comment without contact info.
$subject=$this->randomName();
$body=$this->randomName();
$this->postComment($this->node,$body,$subject,TRUE);// Set $contact to true so that it won't check for id and message.
$this->assertText(t('Your comment has been queued for review by site administrators and will be published after approval.'),t('Comment requires approval.'));
// Test that a user with the 'access comments' permission can see the
// block.
$this->drupalLogin($this->web_user);
$this->drupalGet('');
$this->assertText($block['title'],t('Block was found.'));
// Test the only the 2 latest comments are shown and in the proper order.
$this->assertNoText($comment1->subject,t('Comment not found in block.'));
$this->assertText($comment2->subject,t('Comment found in block.'));
$this->assertText($comment3->comment,t('Comment found in block.'));
$this->assertTrue(strpos($this->drupalGetContent(),$comment3->comment)<strpos($this->drupalGetContent(),$comment2->subject),t('Comments were ordered correctly in block.'));
// Set the number of recent comments to show to 10.
$this->assertTrue(isset($instances['comment_node_'.$type_name]['comment_body']),t('The comment_body field is present for comments on type @type',array('@type'=>$type_name)));