Skip to content

Commit f41fe21

Browse files
Tests: Build the expected edit bookmark URLs with admin_url().
Keeps the `edit_bookmark_link()` expectations consistent with the `get_edit_bookmark_link()` ones, with the escaped `&WordPress#38;` kept literal. See #65819.
1 parent 064eaac commit f41fe21

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎tests/phpunit/tests/link/editBookmarkLink.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ static function ( $location, $link_id ) {
221221
*/
222222
public function test_edit_bookmark_link_default_output() {
223223
$this->expectOutputString(
224-
'<a href="http://' . WP_TESTS_DOMAIN . '/wp-admin/link.php?action=edit&#038;link_id=' . self::$bookmark_id . '">Edit This</a>'
224+
'<a href="' . admin_url( 'link.php?action=edit&#038;link_id=' . self::$bookmark_id ) . '">Edit This</a>'
225225
);
226226

227227
edit_bookmark_link( '', '', '', self::$bookmark_id );
@@ -236,7 +236,7 @@ public function test_edit_bookmark_link_default_output() {
236236
*/
237237
public function test_edit_bookmark_link_custom_text_and_wrapper() {
238238
$this->expectOutputString(
239-
'<p><a href="http://' . WP_TESTS_DOMAIN . '/wp-admin/link.php?action=edit&#038;link_id=' . self::$bookmark_id . '">Edit bookmark</a></p>'
239+
'<p><a href="' . admin_url( 'link.php?action=edit&#038;link_id=' . self::$bookmark_id ) . '">Edit bookmark</a></p>'
240240
);
241241

242242
edit_bookmark_link( 'Edit bookmark', '<p>', '</p>', self::$bookmark_id );
@@ -253,7 +253,7 @@ public function test_edit_bookmark_link_uses_global_bookmark_by_default() {
253253
$GLOBALS['link'] = get_bookmark( self::$global_bookmark_id );
254254

255255
$this->expectOutputString(
256-
'<a href="http://' . WP_TESTS_DOMAIN . '/wp-admin/link.php?action=edit&#038;link_id=' . self::$global_bookmark_id . '">Edit This</a>'
256+
'<a href="' . admin_url( 'link.php?action=edit&#038;link_id=' . self::$global_bookmark_id ) . '">Edit This</a>'
257257
);
258258

259259
edit_bookmark_link();
@@ -330,7 +330,7 @@ static function ( $link, $link_id ) {
330330
2
331331
);
332332

333-
$anchor = '<a href="http://' . WP_TESTS_DOMAIN . '/wp-admin/link.php?action=edit&#038;link_id=' . self::$bookmark_id . '">Edit bookmark</a>';
333+
$anchor = '<a href="' . admin_url( 'link.php?action=edit&#038;link_id=' . self::$bookmark_id ) . '">Edit bookmark</a>';
334334

335335
$this->expectOutputString( '<p><span data-id="' . self::$bookmark_id . '">' . $anchor . '</span></p>' );
336336

0 commit comments

Comments
 (0)