Changeset 59120 for trunk/tests/phpunit/tests/menu/walker-nav-menu.php
- Timestamp:
- 09/30/2024 05:17:54 AM (6 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/menu/walker-nav-menu.php
r56559 r59120 44 44 45 45 /** 46 * Tests when an item's target is _blank, that rel="noopener" is added.47 *48 * @ticket 4329049 */50 public function test_noopener_no_referrer_for_target_blank() {51 $actual = '';52 $post_id = self::factory()->post->create();53 $post_title = get_the_title( $post_id );54 55 $item = array(56 'ID' => $post_id,57 'object_id' => $post_id,58 'title' => $post_title,59 'target' => '_blank',60 'xfn' => '',61 'current' => false,62 );63 64 $args = array(65 'before' => '',66 'after' => '',67 'link_before' => '',68 'link_after' => '',69 );70 71 $this->walker->start_el( $actual, (object) $item, 0, (object) $args );72 73 $this->assertSame( "<li id=\"menu-item-{$post_id}\" class=\"menu-item-{$post_id}\"><a target=\"_blank\" rel=\"noopener\">{$post_title}</a>", $actual );74 }75 76 /**77 46 * @ticket 47720 78 47 * … … 219 188 ), 220 189 'no xfn value and a target of "_blank"' => array( 221 'expected' => 'rel=" noopenerprivacy-policy"',190 'expected' => 'rel="privacy-policy"', 222 191 'xfn' => '', 223 192 'target' => '_blank',
Note: See TracChangeset
for help on using the changeset viewer.