Changeset 39038 for trunk/tests/phpunit/tests/customize/nav-menus.php
- Timestamp:
- 10/30/2016 08:20:54 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/nav-menus.php
r38858 r39038 543 543 $this->assertEquals( 'unknown_post_type', $r->get_error_code() ); 544 544 545 $r = $menus->insert_auto_draft_post( array( 'post_status' => 'publish', 'post_title' => 'Bad', 'post_type' => 'post' ) ); 546 $this->assertInstanceOf( 'WP_Error', $r ); 547 $this->assertEquals( 'status_forbidden', $r->get_error_code() ); 548 545 549 $r = $menus->insert_auto_draft_post( array( 'post_title' => 'Hello World', 'post_type' => 'post' ) ); 546 550 $this->assertInstanceOf( 'WP_Post', $r ); 547 551 $this->assertEquals( 'Hello World', $r->post_title ); 552 $this->assertEquals( 'hello-world', $r->post_name ); 548 553 $this->assertEquals( 'post', $r->post_type ); 549 $this->assertEquals( sanitize_title( $r->post_title ), $r->post_name ); 554 555 $r = $menus->insert_auto_draft_post( array( 'post_title' => 'Hello World', 'post_type' => 'post', 'post_name' => 'greetings-world', 'post_content' => 'Hi World' ) ); 556 $this->assertInstanceOf( 'WP_Post', $r ); 557 $this->assertEquals( 'Hello World', $r->post_title ); 558 $this->assertEquals( 'post', $r->post_type ); 559 $this->assertEquals( 'greetings-world', $r->post_name ); 560 $this->assertEquals( 'Hi World', $r->post_content ); 550 561 } 551 562 … … 732 743 'post_status' => 'auto-draft', 733 744 'post_type' => 'post', 745 'post_name' => 'auto-draft', 734 746 ) ); 735 747 $pre_published_post_id = $this->factory()->post->create( array( 'post_status' => 'publish' ) ); … … 751 763 $this->assertEquals( 'publish', get_post_status( $post_id ) ); 752 764 } 765 766 // Ensure that unique slugs were assigned. 767 $posts = array_map( 'get_post', $post_ids ); 768 $post_names = wp_list_pluck( $posts, 'post_name' ); 769 $this->assertEqualSets( $post_names, array_unique( $post_names ) ); 753 770 } 754 771
Note: See TracChangeset
for help on using the changeset viewer.