Commit 30ca835c authored by catch's avatar catch
Browse files

Issue #3139408 by mondrake, jungle, dww: Replace usages of...

Issue #3139408 by mondrake, jungle, dww: Replace usages of AssertLegacyTrait::assert(No)Field, that is deprecated
parent f5f925c0
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -48,9 +48,9 @@ public function openImportForm() {
    $this->drupalGet('admin/config/services/aggregator/add/opml');
    $this->assertText('A single OPML document may contain many feeds.', 'Found OPML help text.');
    // Ensure that the file upload, remote URL, and refresh fields exist.
    $this->assertField('files[upload]');
    $this->assertField('remote');
    $this->assertField('refresh');
    $this->assertSession()->fieldExists('files[upload]');
    $this->assertSession()->fieldExists('remote');
    $this->assertSession()->fieldExists('refresh');
  }

  /**
+4 −4
Original line number Diff line number Diff line
@@ -56,8 +56,8 @@ public function testLanguageBlockVisibility() {
    $this->drupalGet('admin/structure/block/add/system_powered_by_block' . '/' . $default_theme);
    // Ensure that the language visibility field is visible without a type
    // setting.
    $this->assertField('visibility[language][langcodes][en]');
    $this->assertNoField('visibility[language][context_mapping][language]');
    $this->assertSession()->fieldExists('visibility[language][langcodes][en]');
    $this->assertSession()->fieldNotExists('visibility[language][context_mapping][language]');

    // Enable a standard block and set the visibility setting for one language.
    $edit = [
@@ -139,8 +139,8 @@ public function testMultipleLanguageTypes() {
    // Check if the visibility setting is available with a type setting.
    $default_theme = $this->config('system.theme')->get('default');
    $this->drupalGet('admin/structure/block/add/system_powered_by_block' . '/' . $default_theme);
    $this->assertField('visibility[language][langcodes][en]');
    $this->assertField('visibility[language][context_mapping][language]');
    $this->assertSession()->fieldExists('visibility[language][langcodes][en]');
    $this->assertSession()->fieldExists('visibility[language][context_mapping][language]');

    // Enable a standard block and set visibility to French only.
    $block_id = strtolower($this->randomMachineName(8));
+2 −2
Original line number Diff line number Diff line
@@ -121,11 +121,11 @@ public function testBlockAdminUiPage() {
      $element = $this->xpath('//*[@id="blocks"]/tbody/tr[' . $values['tr'] . ']/td[1]/text()');
      $this->assertEquals($element[0]->getText(), $label, 'The "' . $label . '" block title is set inside the ' . $values['settings']['region'] . ' region.');
      // Look for a test block region select form element.
      $this->assertField('blocks[' . $values['settings']['id'] . '][region]');
      $this->assertSession()->fieldExists('blocks[' . $values['settings']['id'] . '][region]');
      // Move the test block to the header region.
      $edit['blocks[' . $values['settings']['id'] . '][region]'] = 'header';
      // Look for a test block weight select form element.
      $this->assertField('blocks[' . $values['settings']['id'] . '][weight]');
      $this->assertSession()->fieldExists('blocks[' . $values['settings']['id'] . '][weight]');
      // Change the test block's weight.
      $edit['blocks[' . $values['settings']['id'] . '][weight]'] = $values['test_weight'];
    }
+2 −2
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ public function testBookCommentPrint() {
    $this->assertText($comment_body, 'Comment body found');
    $this->assertText(t('Add new comment'), 'Comment form found');
    // Ensure that the comment form subject field exists.
    $this->assertField('subject[0][value]');
    $this->assertSession()->fieldExists('subject[0][value]');

    $this->drupalGet('book/export/html/' . $book_node->id());

@@ -83,7 +83,7 @@ public function testBookCommentPrint() {

    $this->assertNoText(t('Add new comment'), 'Comment form not found');
    // Verify that the comment form subject field is not found.
    $this->assertNoField('subject[0][value]');
    $this->assertSession()->fieldNotExists('subject[0][value]');
  }

}
+3 −3
Original line number Diff line number Diff line
@@ -179,14 +179,14 @@ public function testCommentInterface() {
    $this->assertNotNull($this->node, 'Article node created.');
    $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment');
    $this->assertSession()->statusCodeEquals(403);
    $this->assertNoField('edit-comment');
    $this->assertSession()->fieldNotExists('edit-comment');

    // Attempt to post to node with read-only comments.
    $this->node = $this->drupalCreateNode(['type' => 'article', 'promote' => 1, 'comment' => [['status' => CommentItemInterface::CLOSED]]]);
    $this->assertNotNull($this->node, 'Article node created.');
    $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment');
    $this->assertSession()->statusCodeEquals(403);
    $this->assertNoField('edit-comment');
    $this->assertSession()->fieldNotExists('edit-comment');

    // Attempt to post to node with comments enabled (check field names etc).
    $this->node = $this->drupalCreateNode(['type' => 'article', 'promote' => 1, 'comment' => [['status' => CommentItemInterface::OPEN]]]);
@@ -194,7 +194,7 @@ public function testCommentInterface() {
    $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment');
    $this->assertNoText('This discussion is closed', 'Posting to node with comments enabled');
    // Ensure that the comment body field exists.
    $this->assertField('edit-comment-body-0-value');
    $this->assertSession()->fieldExists('edit-comment-body-0-value');

    // Delete comment and make sure that reply is also removed.
    $this->drupalLogout();
Loading