Changeset 56053 for trunk/tests/phpunit/tests/link/getEditPostLink.php
- Timestamp:
- 06/27/2023 06:00:59 AM (3 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/link/getEditPostLink.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/link/getEditPostLink.php
r55743 r56053 132 132 $this->assertSame( $link_custom_context, get_edit_post_link( $template_part_post, 'something-else' ), 'Pass non-default value in second argument.' ); 133 133 } 134 135 /** 136 * Tests getting the edit post link for a wp_navigation post type. 137 * 138 * @ticket 58589 139 * */ 140 public function test_get_edit_post_link_for_wp_navigation_post_type() { 141 $navigation_post = self::factory()->post->create_and_get( 142 array( 143 'post_type' => 'wp_navigation', 144 'post_name' => 'my_navigation', 145 'post_title' => 'My Navigation', 146 'post_content' => '<!-- wp:navigation-link {"label":"WordPress","type":"custom","url":"http://www.wordpress.org/","kind":"custom"} /-->', 147 'post_excerpt' => 'Description of my Navigation', 148 ) 149 ); 150 151 $post_type_object = get_post_type_object( $navigation_post->post_type ); 152 153 $link_default_context = admin_url( sprintf( $post_type_object->_edit_link, $navigation_post->ID ) ); 154 $link_custom_context = admin_url( sprintf( $post_type_object->_edit_link, $navigation_post->ID ) ); 155 156 $this->assertSame( $link_default_context, get_edit_post_link( $navigation_post ), 'Second argument `$context` has a default context of `"display"`.' ); 157 $this->assertSame( $link_custom_context, get_edit_post_link( $navigation_post, 'something-else' ), 'Pass non-default value in second argument.' ); 158 } 134 159 }
Note: See TracChangeset
for help on using the changeset viewer.