WordPress.org

Make WordPress Core

Changeset 1240 in tests


Ignore:
Timestamp:
03/07/2013 06:49:24 AM (5 years ago)
Author:
nacin
Message:

Allow get_post_ancestors() to inspect the $post global, when null/0 is received. see #23708.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/post.php

    r1175 r1240  
    596596        $this->assertEquals( 'get-page-uri-post-name', get_page_uri( $post_array ) );
    597597    }
     598
     599    /**
     600     * @ticket 23708
     601     */
     602    function test_get_post_ancestors_within_loop() {
     603        global $post;
     604        $parent_id = $this->factory->post->create();
     605        $post = $this->factory->post->create_and_get( array( 'post_parent' => $parent_id ) );
     606        $this->assertEquals( array( $parent_id ), get_post_ancestors( 0 ) );
     607    }
    598608}
Note: See TracChangeset for help on using the changeset viewer.