Changeset 38143 for trunk/tests/phpunit/tests/post.php
- Timestamp:
- 07/23/2016 08:52:52 AM (10 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/post.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post.php
r37857 r38143 640 640 641 641 /** 642 * @ticket 22883643 */644 function test_get_page_uri_with_stdclass_post_object() {645 $post_id = self::factory()->post->create( array( 'post_name' => 'get-page-uri-post-name' ) );646 647 // Mimick an old stdClass post object, missing the ancestors field.648 $post_array = (object) get_post( $post_id, ARRAY_A );649 unset( $post_array->ancestors );650 651 // Dummy assertion. If this test fails, it will actually error out on an E_WARNING.652 $this->assertEquals( 'get-page-uri-post-name', get_page_uri( $post_array ) );653 }654 655 /**656 * @ticket 24491657 */658 function test_get_page_uri_with_nonexistent_post() {659 global $wpdb;660 $post_id = $wpdb->get_var( "SELECT MAX(ID) FROM $wpdb->posts" ) + 1;661 $this->assertFalse( get_page_uri( $post_id ) );662 }663 664 /**665 * @ticket 15963666 */667 function test_get_post_uri_check_orphan() {668 $parent_id = self::factory()->post->create( array( 'post_name' => 'parent' ) );669 $child_id = self::factory()->post->create( array( 'post_name' => 'child', 'post_parent' => $parent_id ) );670 671 // check the parent for good measure672 $this->assertEquals( 'parent', get_page_uri( $parent_id ) );673 674 // try the child normally675 $this->assertEquals( 'parent/child', get_page_uri( $child_id ) );676 677 // now delete the parent from the database and check678 wp_delete_post( $parent_id, true );679 $this->assertEquals( 'child', get_page_uri( $child_id ) );680 }681 682 /**683 642 * @ticket 23708 684 643 */
Note: See TracChangeset
for help on using the changeset viewer.