Changeset 52396
- Timestamp:
- 12/21/2021 12:10:26 AM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/bookmark/wpListBookmarks.php
r52061 r52396 16 16 * @ticket 53839 17 17 * 18 * @param array $args The arguments to create the bookmark. 18 * @param array $args The arguments to create the bookmark. 19 * @param string $expected Expected string to test. 19 20 */ 20 public function test_wp_list_bookmarks_adds_noopener( $args ) {21 $bookmark =self::factory()->bookmark->create( $args );22 $this->assertStringContainsString( 'noopener', wp_list_bookmarks( 'echo=0' ) );21 public function test_wp_list_bookmarks_adds_noopener( $args, $expected ) { 22 self::factory()->bookmark->create( $args ); 23 $this->assertStringContainsString( $expected, wp_list_bookmarks( 'echo=0' ) ); 23 24 } 24 25 … … 31 32 return array( 32 33 'target as "_blank"' => array( 33 'args' => array(34 'args' => array( 34 35 'link_name' => 'With _blank', 35 36 'link_url' => 'https://www.wordpress.org', 36 37 'link_target' => '_blank', 37 38 ), 39 'expected' => 'rel="noopener"', 38 40 ), 39 41 'target as "_blank" and a link relationship' => array( 40 'args' => array(42 'args' => array( 41 43 'link_name' => 'With _blank and a link relationship', 42 44 'link_url' => 'https://www.wordpress.org', 43 45 'link_target' => '_blank', 44 ' rel'=> 'me',46 'link_rel' => 'me', 45 47 ), 48 'expected' => 'rel="me noopener"', 46 49 ), 47 50 'target as "_top"' => array( 48 'args' => array(51 'args' => array( 49 52 'link_name' => 'With _top', 50 53 'link_url' => 'https://www.wordpress.org', 51 54 'link_target' => '_top', 52 55 ), 56 'expected' => 'rel="noopener"', 53 57 ), 54 58 'target as "_top" and a link relationship' => array( 55 'args' => array(59 'args' => array( 56 60 'link_name' => 'With _top and a link relationship', 57 61 'link_url' => 'https://www.wordpress.org', 58 62 'link_target' => '_top', 59 ' rel'=> 'me',63 'link_rel' => 'me', 60 64 ), 65 'expected' => 'rel="me noopener"', 61 66 ), 62 67 ); … … 73 78 */ 74 79 public function test_wp_list_bookmarks_does_not_add_noopener( $args ) { 75 $bookmark =self::factory()->bookmark->create( $args );80 self::factory()->bookmark->create( $args ); 76 81 $this->assertStringNotContainsString( 'noopener', wp_list_bookmarks( 'echo=0' ) ); 77 82 } … … 96 101 'link_url' => 'https://www.wordpress.org', 97 102 'link_target' => '_none', 98 ' rel'=> 'me',103 'link_rel' => 'me', 99 104 ), 100 105 ),
Note: See TracChangeset
for help on using the changeset viewer.