Commit f7f70ff8 authored by alexpott's avatar alexpott

Issue #2375981 by ameymudras, andypost, larowlan, prashantgoel, yogen.prasad,...

Issue #2375981 by ameymudras, andypost, larowlan, prashantgoel, yogen.prasad, swentel, kaustubhb, RavindraSingh, Jeff Burnz: Test that Comments field title does not show when there are no comments
parent c73fdfce
...@@ -26,6 +26,12 @@ class CommentInterfaceTest extends CommentTestBase { ...@@ -26,6 +26,12 @@ class CommentInterfaceTest extends CommentTestBase {
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
$this->drupalLogin($this->adminUser); $this->drupalLogin($this->adminUser);
// Make sure that comment field title is not displayed when there's no
// comments posted.
$this->drupalGet($this->node->urlInfo());
$this->assertNoPattern('@<h2[^>]*>Comments</h2>@', 'Comments title is not displayed.');
// Set comments to have subject and preview disabled.
$this->setCommentPreview(DRUPAL_DISABLED); $this->setCommentPreview(DRUPAL_DISABLED);
$this->setCommentForm(TRUE); $this->setCommentForm(TRUE);
$this->setCommentSubject(FALSE); $this->setCommentSubject(FALSE);
...@@ -44,6 +50,10 @@ public function testCommentInterface() { ...@@ -44,6 +50,10 @@ public function testCommentInterface() {
$comment = $this->postComment($this->node, $comment_text); $comment = $this->postComment($this->node, $comment_text);
$this->assertTrue($this->commentExists($comment), 'Comment found.'); $this->assertTrue($this->commentExists($comment), 'Comment found.');
// Test the comment field title is displayed when there's comments.
$this->drupalGet($this->node->urlInfo());
$this->assertPattern('@<h2[^>]*>Comments</h2>@', 'Comments title is displayed.');
// Set comments to have subject and preview to required. // Set comments to have subject and preview to required.
$this->drupalLogout(); $this->drupalLogout();
$this->drupalLogin($this->adminUser); $this->drupalLogin($this->adminUser);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment