X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcomment%2Fsrc%2FTests%2FCommentTestBase.php;h=3b923ffaf4a40db5ebc451ea72c80cba2b4c903d;hb=1c1cb0980bfa6caf0c24cce671b6bb541dc87583;hp=c42d9883c62e7143877173b688bc18c523028c34;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/modules/comment/src/Tests/CommentTestBase.php b/web/core/modules/comment/src/Tests/CommentTestBase.php index c42d9883c..3b923ffaf 100644 --- a/web/core/modules/comment/src/Tests/CommentTestBase.php +++ b/web/core/modules/comment/src/Tests/CommentTestBase.php @@ -2,6 +2,8 @@ namespace Drupal\comment\Tests; +@trigger_error(__NAMESPACE__ . '\CommentTestBase is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Use \Drupal\Tests\comment\Functional\CommentTestBase instead. See http://www.drupal.org/node/2908490', E_USER_DEPRECATED); + use Drupal\comment\Entity\CommentType; use Drupal\comment\Entity\Comment; use Drupal\comment\CommentInterface; @@ -12,6 +14,11 @@ use Drupal\simpletest\WebTestBase; /** * Provides setup and helper methods for comment tests. + * + * @deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. + * Use \Drupal\Tests\comment\Functional\CommentTestBase instead. + * + * @see https://www.drupal.org/node/2908490 */ abstract class CommentTestBase extends WebTestBase { @@ -159,7 +166,8 @@ abstract class CommentTestBase extends WebTestBase { preg_match('/#comment-([0-9]+)/', $this->getURL(), $match); // Get comment. - if ($contact !== TRUE) { // If true then attempting to find error message. + if ($contact !== TRUE) { + // If true then attempting to find error message. if ($subject) { $this->assertText($subject, 'Comment subject posted.'); } @@ -192,12 +200,12 @@ abstract class CommentTestBase extends WebTestBase { } $comment_title = $comment_element[0]->xpath('div/h3/a'); - if (empty($comment_title) || ((string)$comment_title[0]) !== $comment->getSubject()) { + if (empty($comment_title) || ((string) $comment_title[0]) !== $comment->getSubject()) { return FALSE; } $comment_body = $comment_element[0]->xpath('div/div/p'); - if (empty($comment_body) || ((string)$comment_body[0]) !== $comment->comment_body->value) { + if (empty($comment_body) || ((string) $comment_body[0]) !== $comment->comment_body->value) { return FALSE; } @@ -354,7 +362,7 @@ abstract class CommentTestBase extends WebTestBase { $this->drupalPostForm('admin/content/comment' . ($approval ? '/approval' : ''), $edit, t('Update')); if ($operation == 'delete') { - $this->drupalPostForm(NULL, [], t('Delete comments')); + $this->drupalPostForm(NULL, [], t('Delete')); $this->assertRaw(\Drupal::translation()->formatPlural(1, 'Deleted 1 comment.', 'Deleted @count comments.'), format_string('Operation "@operation" was performed on comment.', ['@operation' => $operation])); } else {