Changeset 42343 for trunk/tests/phpunit/tests/post/getPageUri.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/getPageUri.php
r38145 r42343 10 10 */ 11 11 function test_get_page_uri_with_stdclass_post_object() { 12 $post_id 12 $post_id = self::factory()->post->create( array( 'post_name' => 'get-page-uri-post-name' ) ); 13 13 14 14 // Mimick an old stdClass post object, missing the ancestors field. … … 34 34 function test_get_post_uri_check_orphan() { 35 35 $parent_id = self::factory()->post->create( array( 'post_name' => 'parent' ) ); 36 $child_id = self::factory()->post->create( array( 'post_name' => 'child', 'post_parent' => $parent_id ) ); 36 $child_id = self::factory()->post->create( 37 array( 38 'post_name' => 'child', 39 'post_parent' => $parent_id, 40 ) 41 ); 37 42 38 43 // check the parent for good measure … … 52 57 function test_get_page_uri_with_a_draft_parent_with_empty_slug() { 53 58 $parent_id = self::factory()->post->create( array( 'post_name' => 'parent' ) ); 54 $child_id = self::factory()->post->create( array( 'post_name' => 'child', 'post_parent' => $parent_id ) ); 59 $child_id = self::factory()->post->create( 60 array( 61 'post_name' => 'child', 62 'post_parent' => $parent_id, 63 ) 64 ); 55 65 56 wp_update_post( array( 'ID' => $parent_id, 'post_name' => '', 'post_status' => 'draft' ) ); 66 wp_update_post( 67 array( 68 'ID' => $parent_id, 69 'post_name' => '', 70 'post_status' => 'draft', 71 ) 72 ); 57 73 58 74 $this->assertEquals( 'child', get_page_uri( $child_id ) ); … … 63 79 */ 64 80 function test_get_page_uri_without_argument() { 65 $post_id = self::factory()->post->create(array( 66 'post_title' => 'Blood Orange announces summer tour dates', 67 'post_name' => 'blood-orange-announces-summer-tour-dates', 68 )); 69 $post = get_post( $post_id ); 81 $post_id = self::factory()->post->create( 82 array( 83 'post_title' => 'Blood Orange announces summer tour dates', 84 'post_name' => 'blood-orange-announces-summer-tour-dates', 85 ) 86 ); 87 $post = get_post( $post_id ); 70 88 $this->go_to( get_permalink( $post_id ) ); 71 89 $this->assertEquals( 'blood-orange-announces-summer-tour-dates', get_page_uri() );
Note: See TracChangeset
for help on using the changeset viewer.