mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Implement canonical and url_to_postid() tests for child pages which share a post name with other child pages.
See #32759 git-svn-id: https://develop.svn.wordpress.org/trunk@32918 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -80,6 +80,31 @@ class WP_Canonical_UnitTestCase extends WP_UnitTestCase {
|
||||
array( 'import_id' => 144, 'post_type' => 'page', 'post_title' => 'child-page-1', 'post_parent' => $post_id,
|
||||
) );
|
||||
|
||||
self::$post_ids[] = $parent_id = $factory->post->create( array(
|
||||
'post_name' => 'parent',
|
||||
'post_type' => 'page',
|
||||
) );
|
||||
self::$post_ids[] = $child_id_1 = $factory->post->create( array(
|
||||
'post_name' => 'child1',
|
||||
'post_type' => 'page',
|
||||
'post_parent' => $parent_id,
|
||||
) );
|
||||
self::$post_ids[] = $child_id_2 = $factory->post->create( array(
|
||||
'post_name' => 'child2',
|
||||
'post_type' => 'page',
|
||||
'post_parent' => $parent_id,
|
||||
) );
|
||||
self::$post_ids[] = $grandchild_id_1 = $factory->post->create( array(
|
||||
'post_name' => 'grandchild',
|
||||
'post_type' => 'page',
|
||||
'post_parent' => $child_id_1,
|
||||
) );
|
||||
self::$post_ids[] = $grandchild_id_2 = $factory->post->create( array(
|
||||
'post_name' => 'grandchild',
|
||||
'post_type' => 'page',
|
||||
'post_parent' => $child_id_2,
|
||||
) );
|
||||
|
||||
$cat1 = $factory->term->create( array( 'taxonomy' => 'category', 'name' => 'parent' ) );
|
||||
self::$terms['/category/parent/'] = $cat1;
|
||||
self::$term_ids[ $cat1 ] = 'category';
|
||||
|
||||
Reference in New Issue
Block a user