Make WordPress Core


Ignore:
Timestamp:
06/24/2015 12:40:45 AM (11 years ago)
Author:
johnbillion
Message:

Implement canonical and url_to_postid() tests for child pages which share a post name with other child pages.

See #32759

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/testcase-canonical.php

    r30278 r32918  
    8181        ) );
    8282
     83        self::$post_ids[] = $parent_id = $factory->post->create( array(
     84            'post_name' => 'parent',
     85            'post_type' => 'page',
     86        ) );
     87        self::$post_ids[] = $child_id_1 = $factory->post->create( array(
     88            'post_name'   => 'child1',
     89            'post_type'   => 'page',
     90            'post_parent' => $parent_id,
     91        ) );
     92        self::$post_ids[] = $child_id_2 = $factory->post->create( array(
     93            'post_name'   => 'child2',
     94            'post_type'   => 'page',
     95            'post_parent' => $parent_id,
     96        ) );
     97        self::$post_ids[] = $grandchild_id_1 = $factory->post->create( array(
     98            'post_name'   => 'grandchild',
     99            'post_type'   => 'page',
     100            'post_parent' => $child_id_1,
     101        ) );
     102        self::$post_ids[] = $grandchild_id_2 = $factory->post->create( array(
     103            'post_name'   => 'grandchild',
     104            'post_type'   => 'page',
     105            'post_parent' => $child_id_2,
     106        ) );
     107
    83108        $cat1 = $factory->term->create( array( 'taxonomy' => 'category', 'name' => 'parent' ) );
    84109        self::$terms['/category/parent/'] = $cat1;
Note: See TracChangeset for help on using the changeset viewer.