Verified Commit ea9e2403 authored by Dave Long's avatar Dave Long
Browse files

test: #3585774 rename xpath() methods in tests

By: joachim
By: mstrelan
By: brandonlira
By: dcam
By: nitinkumar_7
By: longwave
parent 97b0f9ad
Loading
Loading
Loading
Loading
Loading
+2 −2
Changes for core/modules/block/tests/src/Functional/BlockTest.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -635,11 +635,11 @@ public function testBlockTitle(): void {
    $this->submitForm($edit, 'Save block');

    // Ensure that the title is displayed as plain text.
    $elements = $this->xpath('//table/tbody/tr//td[contains(@class, "block")]');
    $elements = $this->getNodeElementsByXpath('//table/tbody/tr//td[contains(@class, "block")]');
    $this->assertEquals($title, $elements[0]->getText());

    $this->clickLink('Disable');
    $elements = $this->xpath('//table/tbody/tr//td[contains(@class, "block")]');
    $elements = $this->getNodeElementsByXpath('//table/tbody/tr//td[contains(@class, "block")]');
    $this->assertEquals("$title (disabled)", $elements[0]->getText());
  }

+1 −1
Changes for core/modules/block/tests/src/Functional/BlockUiTest.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ public function testBlockDemoUiPage(): void {
      $block->delete();
    }
    $this->drupalGet('admin/structure/block');
    $blocks_table = $this->xpath("//tr[@class='block-enabled']");
    $blocks_table = $this->getNodeElementsByXpath("//tr[@class='block-enabled']");
    $this->assertEmpty($blocks_table, 'The blocks table is now empty.');
    $this->submitForm([], 'Save blocks');
    $this->assertSession()->pageTextContains('No blocks settings to update');
+2 −2
Changes for core/modules/block_content/tests/src/Functional/BlockContentListViewsTest.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -183,7 +183,7 @@ public function testListing(): void {
    $this->drupalGet('admin/content/block');
    $this->assertSession()->statusCodeEquals(200);
    $this->assertSession()->linkNotExists('Add content block');
    $matches = $this->xpath('//td[1]');
    $matches = $this->getNodeElementsByXpath('//td[1]');
    $actual = $matches[0]->getText();
    $this->assertEquals($label, $actual, 'Label found for test block.');
    $this->assertSession()->linkNotExists('Edit');
@@ -197,7 +197,7 @@ public function testListing(): void {
    $this->drupalGet('admin/content/block');
    $this->assertSession()->statusCodeEquals(200);
    $this->assertSession()->linkExists('Add content block');
    $matches = $this->xpath('//td/a');
    $matches = $this->getNodeElementsByXpath('//td/a');
    $actual = $matches[0]->getText();
    $this->assertEquals($label, $actual, 'Label found for test block.');
    $this->assertSession()->linkByHrefExists('admin/content/block/' . $test_block->id());
+1 −1
Changes for core/modules/block_content/tests/src/Functional/Views/BlockContentIntegrationTest.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ public function testBlockContentViewTypeArgument(): void {
   * @internal
   */
  protected function assertIds(array $expected_ids = []): void {
    $result = $this->xpath('//span[@class="field-content"]');
    $result = $this->getNodeElementsByXpath('//span[@class="field-content"]');
    $ids = [];
    foreach ($result as $element) {
      $ids[] = $element->getText();
+2 −2
Changes for core/modules/comment/tests/src/Functional/CommentPagerTest.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -237,7 +237,7 @@ public function assertCommentOrder(array $comments, array $expected_order): void
      $expected_cids[] = $comments[$key]->id();
    }

    $comment_anchors = $this->xpath('//article[starts-with(@id,"comment-")]');
    $comment_anchors = $this->getNodeElementsByXpath('//article[starts-with(@id,"comment-")]');
    $result_order = [];
    foreach ($comment_anchors as $anchor) {
      $result_order[] = substr($anchor->getAttribute('id'), 8);
@@ -443,7 +443,7 @@ public function testTwoPagers(): void {
   */
  protected function clickLinkWithXPath($xpath, array $arguments = [], $index = 0): string|false {
    $url_before = $this->getUrl();
    $urls = $this->xpath($xpath, $arguments);
    $urls = $this->getNodeElementsByXpath($xpath, $arguments);
    if (isset($urls[$index])) {
      $url_target = $this->getAbsoluteUrl($urls[$index]->getAttribute('href'));
      return $this->drupalGet($url_target);
Loading