Ticket #53839: 53839-2.diff
| File 53839-2.diff, 1.6 KB (added by , 4 years ago) |
|---|
-
tests/phpunit/tests/bookmark/wpListBookmarks.php
41 41 'link_name' => 'With _blank and a link relationship', 42 42 'link_url' => 'https://www.wordpress.org', 43 43 'link_target' => '_blank', 44 ' rel'=> 'me',44 'link_rel' => 'me', 45 45 ), 46 46 ), 47 47 'target as "_top"' => array( … … 56 56 'link_name' => 'With _top and a link relationship', 57 57 'link_url' => 'https://www.wordpress.org', 58 58 'link_target' => '_top', 59 ' rel'=> 'me',59 'link_rel' => 'me', 60 60 ), 61 61 ), 62 62 ); … … 95 95 'link_name' => 'With _blank and a link relationship', 96 96 'link_url' => 'https://www.wordpress.org', 97 97 'link_target' => '_none', 98 ' rel'=> 'me',98 'link_rel' => 'me', 99 99 ), 100 100 ), 101 101 ); 102 102 } 103 104 /** 105 * Test that wp_list_bookmarsk does add "noopener" to the "rel" attribute, while 106 * preserving the original value of the attribute. 107 */ 108 public function test_wp_list_bookmarks_adds_noopener_keep_original() { 109 $args = array( 110 'link_name' => 'With _blank and a link relationship', 111 'link_url' => 'https://www.wordpress.org', 112 'link_target' => '_blank', 113 'link_rel' => 'me', 114 ); 115 116 $bookmark = self::factory()->bookmark->create( $args ); 117 118 $this->assertStringContainsString( 'rel="me noopener"', wp_list_bookmarks( 'echo=0' ) ); 119 } 103 120 }