summaryrefslogtreecommitdiffstatshomepage
path: root/tests/phpunit/includes/testcase-canonical.php
diff options
context:
space:
mode:
authorJohn Blackbourn <johnbillion@git.wordpress.org>2015-06-24 00:40:45 +0000
committerJohn Blackbourn <johnbillion@git.wordpress.org>2015-06-24 00:40:45 +0000
commit8c22c526bdecce68efb7b255d707c63abb8459ec (patch)
treeabebaf268d2d62378344e900ed2ea09a7d338649 /tests/phpunit/includes/testcase-canonical.php
parent06ed4c4d0f07715da4869a37b99a42d0cae12366 (diff)
downloadwordpress-8c22c526bdecce68efb7b255d707c63abb8459ec.tar.gz
wordpress-8c22c526bdecce68efb7b255d707c63abb8459ec.zip
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
Diffstat (limited to 'tests/phpunit/includes/testcase-canonical.php')
-rw-r--r--tests/phpunit/includes/testcase-canonical.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/phpunit/includes/testcase-canonical.php b/tests/phpunit/includes/testcase-canonical.php
index 3c6e45d948..35a2d9728e 100644
--- a/tests/phpunit/includes/testcase-canonical.php
+++ b/tests/phpunit/includes/testcase-canonical.php
@@ -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';