Verified Commit 050b91b7 authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #3160405 by mondrake, ravi.shankar, jungle, longwave: Deprecate...

Issue #3160405 by mondrake, ravi.shankar, jungle, longwave: Deprecate overloading arguments to WebAssert methods to prevent conversions of legacy Simpletest test to carry over cruft
parent 82949679
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -141,11 +141,15 @@ public function testMultipleClosingBodies_2678662() {

    // Besides verifying there is no JavaScript syntax error, also verify the
    // HTML structure.
    // The BigPipe stop signal is present just before the closing </body> and
    // </html> tags.
    $this->assertSession()
      ->responseContains(BigPipe::STOP_SIGNAL . "\n\n\n</body></html>", 'The BigPipe stop signal is present just before the closing </body> and </html> tags.');
      ->responseContains(BigPipe::STOP_SIGNAL . "\n\n\n</body></html>");
    $js_code_until_closing_body_tag = substr(BigPipeRegressionTestController::MARKER_2678662, 0, strpos(BigPipeRegressionTestController::MARKER_2678662, '</body>'));
    // The BigPipe start signal does NOT start at the closing </body> tag string
    // in an inline script.
    $this->assertSession()
      ->responseNotContains($js_code_until_closing_body_tag . "\n" . BigPipe::START_SIGNAL, 'The BigPipe start signal does NOT start at the closing </body> tag string in an inline script.');
      ->responseNotContains($js_code_until_closing_body_tag . "\n" . BigPipe::START_SIGNAL);
  }

  /**
+4 −2
Original line number Diff line number Diff line
@@ -175,7 +175,8 @@ public function testAnonymous() {
    // NOTE: if authenticated user has permission to post comments, then a
    // "Login or register to post comments" type link may be shown.
    $this->drupalGet('node/' . $this->node->id());
    $this->assertSession()->responseNotMatches('@<h2[^>]*>Comments</h2>@', 'Comments were not displayed.');
    // Verify that comments were not displayed.
    $this->assertSession()->responseNotMatches('@<h2[^>]*>Comments</h2>@');
    $this->assertSession()->linkNotExists('Add new comment', 'Link to add comment was found.');

    // Attempt to view node-comment form while disallowed.
@@ -199,7 +200,8 @@ public function testAnonymous() {
      'skip comment approval' => TRUE,
    ]);
    $this->drupalGet('node/' . $this->node->id());
    $this->assertSession()->responseNotMatches('@<h2[^>]*>Comments</h2>@', 'Comments were not displayed.');
    // Verify that comments were not displayed.
    $this->assertSession()->responseNotMatches('@<h2[^>]*>Comments</h2>@');
    $this->assertFieldByName('subject[0][value]', '', 'Subject field found.');
    $this->assertFieldByName('comment_body[0][value]', '', 'Comment field found.');

+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ protected function setUp(): void {
    // Make sure that comment field title is not displayed when there's no
    // comments posted.
    $this->drupalGet($this->node->toUrl());
    $this->assertSession()->responseNotMatches('@<h2[^>]*>Comments</h2>@', 'Comments title is not displayed.');
    $this->assertSession()->responseNotMatches('@<h2[^>]*>Comments</h2>@');

    // Set comments to have subject and preview disabled.
    $this->setCommentPreview(DRUPAL_DISABLED);
+4 −2
Original line number Diff line number Diff line
@@ -354,7 +354,8 @@ public function testCommentFunctionality() {

    // Attempt to view comments while disallowed.
    $this->drupalGet('entity-test/' . $this->entity->id());
    $this->assertSession()->responseNotMatches('@<h2[^>]*>Comments</h2>@', 'Comments were not displayed.');
    // Verify that comments were not displayed.
    $this->assertSession()->responseNotMatches('@<h2[^>]*>Comments</h2>@');
    $this->assertSession()->linkNotExists('Add new comment', 'Link to add comment was found.');

    // Attempt to view test entity comment form while disallowed.
@@ -387,7 +388,8 @@ public function testCommentFunctionality() {
      'view test entity' => TRUE,
    ]);
    $this->drupalGet('entity_test/' . $this->entity->id());
    $this->assertSession()->responseNotMatches('@<h2[^>]*>Comments</h2>@', 'Comments were not displayed.');
    // Verify that comments were not displayed.
    $this->assertSession()->responseNotMatches('@<h2[^>]*>Comments</h2>@');
    $this->assertFieldByName('subject[0][value]', '', 'Subject field found.');
    $this->assertFieldByName('comment_body[0][value]', '', 'Comment field found.');

+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ public function testCommentEmptyTitles() {
    // Verify that the comment is created successfully.
    $this->assertSession()->responseMatches($regex);
    // Tests that markup is not generated for the comment without header.
    $this->assertSession()->responseNotMatches('|<h3[^>]*></h3>|', 'Comment title H3 element not found when title is an empty string.');
    $this->assertSession()->responseNotMatches('|<h3[^>]*></h3>|');
  }

  /**
Loading