summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2015-09-26 13:57:21 (GMT)
committerAlex Pott2015-09-26 13:57:21 (GMT)
commitf7f70ff8cf48bc59f158709e0c9d445ff1f31402 (patch)
treef4470237269001d0aa869b10637a8217b311bda4
parentc73fdfce64587068962d230737be567bdf55a716 (diff)
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
-rw-r--r--core/modules/comment/src/Tests/CommentInterfaceTest.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/modules/comment/src/Tests/CommentInterfaceTest.php b/core/modules/comment/src/Tests/CommentInterfaceTest.php
index 0dc5ea2..4b326a6 100644
--- a/core/modules/comment/src/Tests/CommentInterfaceTest.php
+++ b/core/modules/comment/src/Tests/CommentInterfaceTest.php
@@ -26,6 +26,12 @@ class CommentInterfaceTest extends CommentTestBase {
public function setUp() {
parent::setUp();
$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->setCommentForm(TRUE);
$this->setCommentSubject(FALSE);
@@ -44,6 +50,10 @@ class CommentInterfaceTest extends CommentTestBase {
$comment = $this->postComment($this->node, $comment_text);
$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.
$this->drupalLogout();
$this->drupalLogin($this->adminUser);