- Timestamp:
- 12/05/2016 07:38:16 PM (8 years ago)
- Location:
- branches/4.7
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.7
-
branches/4.7/tests/phpunit/tests/customize/nav-menus.php
r39038 r39507 550 550 $this->assertInstanceOf( 'WP_Post', $r ); 551 551 $this->assertEquals( 'Hello World', $r->post_title ); 552 $this->assertEquals( 'hello-world', $r->post_name ); 552 $this->assertEquals( '', $r->post_name ); 553 $this->assertEquals( 'hello-world', get_post_meta( $r->ID, '_customize_draft_post_name', true ) ); 553 554 $this->assertEquals( 'post', $r->post_type ); 554 555 … … 557 558 $this->assertEquals( 'Hello World', $r->post_title ); 558 559 $this->assertEquals( 'post', $r->post_type ); 559 $this->assertEquals( 'greetings-world', $r->post_name ); 560 $this->assertEquals( '', $r->post_name ); 561 $this->assertEquals( 'greetings-world', get_post_meta( $r->ID, '_customize_draft_post_name', true ) ); 560 562 $this->assertEquals( 'Hi World', $r->post_content ); 561 563 } … … 740 742 do_action( 'customize_register', $this->wp_customize ); 741 743 742 $post_ids = $this->factory()->post->create_many( 3, array( 743 'post_status' => 'auto-draft', 744 'post_type' => 'post', 745 'post_name' => 'auto-draft', 746 ) ); 744 $post_ids = array(); 745 for ( $i = 0; $i < 3; $i += 1 ) { 746 $r = $menus->insert_auto_draft_post( array( 747 'post_title' => 'Auto Draft ' . $i, 748 'post_type' => 'post', 749 'post_name' => 'auto-draft-' . $i, 750 ) ); 751 $this->assertInstanceOf( 'WP_Post', $r ); 752 $post_ids[] = $r->ID; 753 } 754 747 755 $pre_published_post_id = $this->factory()->post->create( array( 'post_status' => 'publish' ) ); 748 756 … … 755 763 foreach ( $post_ids as $post_id ) { 756 764 $this->assertEquals( 'auto-draft', get_post_status( $post_id ) ); 765 $this->assertEmpty( get_post( $post_id )->post_name ); 766 $this->assertNotEmpty( get_post_meta( $post_id, '_customize_draft_post_name', true ) ); 757 767 } 758 768 … … 762 772 foreach ( $post_ids as $post_id ) { 763 773 $this->assertEquals( 'publish', get_post_status( $post_id ) ); 774 $this->assertRegExp( '/^auto-draft-\d+$/', get_post( $post_id )->post_name ); 775 $this->assertEmpty( get_post_meta( $post_id, '_customize_draft_post_name', true ) ); 764 776 } 765 777
Note: See TracChangeset
for help on using the changeset viewer.