comparison core/modules/comment/tests/src/Functional/CommentTitleTest.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
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 */