Changeset 40676 for trunk/tests/phpunit/tests/theme.php
- Timestamp:
- 05/16/2017 05:36:25 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/theme.php
r40524 r40676 310 310 $this->assertEquals($style, get_stylesheet()); 311 311 } 312 313 /** 314 * Test _wp_keep_alive_customize_changeset_dependent_auto_drafts. 315 * 316 * @covers _wp_keep_alive_customize_changeset_dependent_auto_drafts() 317 */ 318 function test_wp_keep_alive_customize_changeset_dependent_auto_drafts() { 319 $nav_created_post_ids = $this->factory()->post->create_many(2, array( 320 'post_status' => 'auto-draft', 321 ) ); 322 $data = array( 323 'nav_menus_created_posts' => array( 324 'value' => $nav_created_post_ids, 325 ), 326 ); 327 wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); 328 require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; 329 $wp_customize = new WP_Customize_Manager(); 330 do_action( 'customize_register', $wp_customize ); 331 $wp_customize->save_changeset_post( array( 332 'data' => $data, 333 ) ); 334 $this->assertEquals( get_post( $nav_created_post_ids[0] )->post_date, get_post( $wp_customize->changeset_post_id() )->post_date ); 335 $this->assertEquals( get_post( $nav_created_post_ids[1] )->post_date, get_post( $wp_customize->changeset_post_id() )->post_date ); 336 $wp_customize->save_changeset_post( array( 337 'status' => 'draft', 338 'data' => $data, 339 ) ); 340 $expected_year = date( 'Y' ) + 100; 341 $this->assertEquals( $expected_year, date( 'Y', strtotime( get_post( $nav_created_post_ids[0] )->post_date ) ) ); 342 $this->assertEquals( $expected_year, date( 'Y', strtotime( get_post( $nav_created_post_ids[1] )->post_date ) ) ); 343 } 312 344 }
Note: See TracChangeset
for help on using the changeset viewer.