Changeset 39507 for branches/4.7/tests/phpunit/tests/customize/manager.php
- Timestamp:
- 12/05/2016 07:38:16 PM (7 years ago)
- Location:
- branches/4.7
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.7
-
branches/4.7/tests/phpunit/tests/customize/manager.php
r39435 r39507 454 454 } else { 455 455 $this->assertEquals( 'auto-draft', $post->post_status ); 456 $this->assertEmpty( $post->post_name ); 456 457 } 457 $posts_by_name[ $post->post_name ] = $post->ID; 458 $post_name = $post->post_name; 459 if ( empty( $post_name ) ) { 460 $post_name = get_post_meta( $post->ID, '_customize_draft_post_name', true ); 461 } 462 $posts_by_name[ $post_name ] = $post->ID; 458 463 } 459 464 $this->assertEquals( array( 'waffles', 'canola', 'home', 'about', 'blog', 'custom' ), array_keys( $posts_by_name ) ); … … 465 470 $attachment_metadata = wp_get_attachment_metadata( $posts_by_name['waffles'] ); 466 471 $this->assertEquals( 'Waffles', get_post( $posts_by_name['waffles'] )->post_title ); 472 $this->assertEquals( 'waffles', get_post_meta( $posts_by_name['waffles'], '_customize_draft_post_name', true ) ); 467 473 $this->assertArrayHasKey( 'file', $attachment_metadata ); 468 474 $this->assertContains( 'waffles', $attachment_metadata['file'] ); … … 489 495 $wp_customize->import_theme_starter_content(); 490 496 $changeset_data = $wp_customize->changeset_data(); 491 $this->assertEqualSets( array_values( $posts_by_name ), $changeset_data['nav_menus_created_posts']['value'] , 'Auto-drafts should not get re-created and amended with each import.' );497 $this->assertEqualSets( array_values( $posts_by_name ), $changeset_data['nav_menus_created_posts']['value'] ); // Auto-drafts should not get re-created and amended with each import. 492 498 493 499 // Test that saving non-starter content on top of the changeset clears the starter_content flag. … … 540 546 $this->assertContains( 'waffles', get_header_image() ); 541 547 $this->assertContains( 'waffles', get_background_image() ); 548 $this->assertEquals( 'waffles', get_post( $posts_by_name['waffles'] )->post_name ); 549 $this->assertEmpty( get_post_meta( $posts_by_name['waffles'], '_customize_draft_post_name', true ) ); 542 550 } 543 551
Note: See TracChangeset
for help on using the changeset viewer.