X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcomment%2Ftests%2Fsrc%2FFunctional%2FCommentPagerTest.php;fp=web%2Fcore%2Fmodules%2Fcomment%2Fsrc%2FTests%2FCommentPagerTest.php;h=9cbc61dbe1a40695881a7fb019a89eac2157c0e0;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=48326bca6e459ba63fbec15d956a51f34afe58ef;hpb=74df008bdbb3a11eeea356744f39b802369bda3c;p=yaffs-website diff --git a/web/core/modules/comment/src/Tests/CommentPagerTest.php b/web/core/modules/comment/tests/src/Functional/CommentPagerTest.php similarity index 96% rename from web/core/modules/comment/src/Tests/CommentPagerTest.php rename to web/core/modules/comment/tests/src/Functional/CommentPagerTest.php index 48326bca6..9cbc61dbe 100644 --- a/web/core/modules/comment/src/Tests/CommentPagerTest.php +++ b/web/core/modules/comment/tests/src/Functional/CommentPagerTest.php @@ -1,9 +1,9 @@ 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)])); } @@ -328,7 +329,7 @@ class CommentPagerTest extends CommentTestBase { 'settings' => [ 'pager_id' => 1, 'view_mode' => 'default', - ] + ], ]) ->save(); @@ -338,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'); @@ -421,11 +422,11 @@ class CommentPagerTest extends CommentTestBase { $url_before = $this->getUrl(); $urls = $this->xpath($xpath, $arguments); if (isset($urls[$index])) { - $url_target = $this->getAbsoluteUrl($urls[$index]['href']); - $this->pass(SafeMarkup::format('Clicked link %label (@url_target) from @url_before', ['%label' => $xpath, '@url_target' => $url_target, '@url_before' => $url_before]), 'Browser'); + $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); } - $this->fail(SafeMarkup::format('Link %label does not exist on @url_before', ['%label' => $xpath, '@url_before' => $url_before]), 'Browser'); + $this->fail(new FormattableMarkup('Link %label does not exist on @url_before', ['%label' => $xpath, '@url_before' => $url_before]), 'Browser'); return FALSE; }