From 2650c434098891b675d8de0d7931491081e0c85a Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Mon, 30 Jul 2018 11:33:13 +0100 Subject: [PATCH] Issue #2809467 by michielnugter, Lendude: Convert \Drupal\comment\Tests\CommentPagerTest to BrowserTestBase --- .../src/Functional}/CommentPagerTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename core/modules/comment/{src/Tests => tests/src/Functional}/CommentPagerTest.php (98%) diff --git a/core/modules/comment/src/Tests/CommentPagerTest.php b/core/modules/comment/tests/src/Functional/CommentPagerTest.php similarity index 98% rename from core/modules/comment/src/Tests/CommentPagerTest.php rename to core/modules/comment/tests/src/Functional/CommentPagerTest.php index de45c86cdb1..9cbc61dbe1a 100644 --- a/core/modules/comment/src/Tests/CommentPagerTest.php +++ b/core/modules/comment/tests/src/Functional/CommentPagerTest.php @@ -1,6 +1,6 @@ xpath('//a[starts-with(@id,"comment-")]'); $result_order = []; foreach ($comment_anchors as $anchor) { - $result_order[] = substr($anchor['id'], 8); + $result_order[] = substr($anchor->getAttribute('id'), 8); } return $this->assertEqual($expected_cids, $result_order, format_string('Comment order: expected @expected, returned @returned.', ['@expected' => implode(',', $expected_cids), '@returned' => implode(',', $result_order)])); } @@ -339,12 +339,12 @@ class CommentPagerTest extends CommentTestBase { $this->drupalGet('admin/structure/types/manage/article/display'); $this->assertNoText(t('Pager ID: @id', ['@id' => 0]), 'No summary for standard pager'); $this->assertText(t('Pager ID: @id', ['@id' => 1])); - $this->drupalPostAjaxForm(NULL, [], 'comment_settings_edit'); + $this->drupalPostForm(NULL, [], 'comment_settings_edit'); // Change default pager to 2. $this->drupalPostForm(NULL, ['fields[comment][settings_edit_form][settings][pager_id]' => 2], t('Save')); $this->assertText(t('Pager ID: @id', ['@id' => 2])); // Revert the changes. - $this->drupalPostAjaxForm(NULL, [], 'comment_settings_edit'); + $this->drupalPostForm(NULL, [], 'comment_settings_edit'); $this->drupalPostForm(NULL, ['fields[comment][settings_edit_form][settings][pager_id]' => 0], t('Save')); $this->assertNoText(t('Pager ID: @id', ['@id' => 0]), 'No summary for standard pager'); @@ -422,7 +422,7 @@ class CommentPagerTest extends CommentTestBase { $url_before = $this->getUrl(); $urls = $this->xpath($xpath, $arguments); if (isset($urls[$index])) { - $url_target = $this->getAbsoluteUrl($urls[$index]['href']); + $url_target = $this->getAbsoluteUrl($urls[$index]->getAttribute('href')); $this->pass(new FormattableMarkup('Clicked link %label (@url_target) from @url_before', ['%label' => $xpath, '@url_target' => $url_target, '@url_before' => $url_before]), 'Browser'); return $this->drupalGet($url_target); }