Mercurial > hg > isophonics-drupal-site
comparison core/modules/comment/tests/src/Functional/CommentTitleTest.php @ 18:af1871eacc83
Update to Drupal core 8.7.1
| author | Chris Cannam |
|---|---|
| date | Thu, 09 May 2019 15:33:08 +0100 |
| parents | 129ea1e6d783 |
| children |
comparison
equal
deleted
inserted
replaced
| 17:129ea1e6d783 | 18:af1871eacc83 |
|---|---|
| 35 // Anonymous. | 35 // Anonymous. |
| 36 $this->assertNull($comment->name->value); | 36 $this->assertNull($comment->name->value); |
| 37 $this->assertNull($comment->mail->value); | 37 $this->assertNull($comment->mail->value); |
| 38 | 38 |
| 39 // Confirm that the comment was created. | 39 // Confirm that the comment was created. |
| 40 $regex = '/<a id="comment-' . $comment->id() . '"(.*?)'; | 40 $regex = '/<article(.*?)id="comment-' . $comment->id() . '"(.*?)'; |
| 41 $regex .= $comment->comment_body->value . '(.*?)'; | 41 $regex .= $comment->comment_body->value . '(.*?)'; |
| 42 $regex .= '/s'; | 42 $regex .= '/s'; |
| 43 $this->assertPattern($regex, 'Comment is created successfully'); | 43 $this->assertPattern($regex, 'Comment is created successfully'); |
| 44 // Tests that markup is not generated for the comment without header. | 44 // Tests that markup is not generated for the comment without header. |
| 45 $this->assertNoPattern('|<h3[^>]*></h3>|', 'Comment title H3 element not found when title is an empty string.'); | 45 $this->assertSession()->responseNotMatches('|<h3[^>]*></h3>|', 'Comment title H3 element not found when title is an empty string.'); |
| 46 } | 46 } |
| 47 | 47 |
| 48 /** | 48 /** |
| 49 * Tests markup for comments with populated titles. | 49 * Tests markup for comments with populated titles. |
| 50 */ | 50 */ |
