Verified Commit 83da1db4 authored by Dave Long's avatar Dave Long
Browse files

Issue #3368145 by Spokje: Use constants when calling CommentTestBase::setCommentAnonymous

(cherry picked from commit b9d2e855)
parent 5a47e624
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace Drupal\Tests\comment\Functional;

use Drupal\comment\CommentInterface;
use Drupal\Component\Render\FormattableMarkup;
use Drupal\Component\Utility\Html;
use Drupal\language\Entity\ConfigurableLanguage;
@@ -41,7 +42,7 @@ public function testApprovalAdminInterface() {
    ]);
    $this->drupalLogin($this->adminUser);
    // Ensure that doesn't require contact info.
    $this->setCommentAnonymous('0');
    $this->setCommentAnonymous(CommentInterface::ANONYMOUS_MAYNOT_CONTACT);

    // Test that the comments page loads correctly when there are no comments
    $this->drupalGet('admin/content/comment');
@@ -134,7 +135,7 @@ public function testApprovalNodeInterface() {
    ]);
    $this->drupalLogin($this->adminUser);
    // Ensure that doesn't require contact info.
    $this->setCommentAnonymous('0');
    $this->setCommentAnonymous(CommentInterface::ANONYMOUS_MAYNOT_CONTACT);
    $this->drupalLogout();

    // Post anonymous comment without contact info.
@@ -220,7 +221,7 @@ public function testEditComment() {
    // Post anonymous comment.
    $this->drupalLogin($this->adminUser);
    // Ensure that we need email id before posting comment.
    $this->setCommentAnonymous('2');
    $this->setCommentAnonymous(CommentInterface::ANONYMOUS_MUST_CONTACT);
    $this->drupalLogout();

    // Post comment with contact info (required).
@@ -256,7 +257,7 @@ public function testCommentedTranslationDeletion() {
    // Rebuild the container to update the default language container variable.
    $this->rebuildContainer();
    // Ensure that doesn't require contact info.
    $this->setCommentAnonymous('0');
    $this->setCommentAnonymous(CommentInterface::ANONYMOUS_MAYNOT_CONTACT);
    $this->drupalLogin($this->webUser);
    $count_query = \Drupal::entityTypeManager()
      ->getStorage('comment')
+0 −1
Original line number Diff line number Diff line
@@ -83,7 +83,6 @@ public function testCommentLinks() {

    // Change comment settings.
    $this->setCommentSettings('form_location', CommentItemInterface::FORM_BELOW, 'Set comment form location');
    $this->setCommentAnonymous(TRUE);
    $this->node->comment = CommentItemInterface::OPEN;
    $this->node->save();

+2 −1
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace Drupal\Tests\comment\Functional;

use Drupal\comment\CommentInterface;
use Drupal\comment\CommentManagerInterface;
use Drupal\comment\Entity\Comment;

@@ -89,7 +90,7 @@ public function testCommentNodeCommentStatistics() {
    $this->drupalLogout();

    // Ensure that the poster can leave some contact info.
    $this->setCommentAnonymous('1');
    $this->setCommentAnonymous(CommentInterface::ANONYMOUS_MAY_CONTACT);

    // Post comment #2 as anonymous (comment approval enabled).
    $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment');
+2 −1
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@

use Drupal\block_content\Entity\BlockContent;
use Drupal\block_content\Entity\BlockContentType;
use Drupal\comment\CommentInterface;
use Drupal\comment\Entity\Comment;
use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
use Drupal\Tests\comment\Functional\CommentTestBase as CommentBrowserTestBase;
@@ -48,7 +49,7 @@ public function testApprovalAdminInterface() {
    $this->drupalPlaceBlock('page_title_block');
    $this->drupalLogin($this->adminUser);
    // Ensure that doesn't require contact info.
    $this->setCommentAnonymous('0');
    $this->setCommentAnonymous(CommentInterface::ANONYMOUS_MAYNOT_CONTACT);

    // Test that the comments page loads correctly when there are no comments.
    $this->drupalGet('admin/content/comment');