Changeset 40099 for branches/4.7/tests/phpunit/tests/customize/manager.php
- Timestamp:
- 02/21/2017 07:02:14 AM (8 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
r40098 r40099 1106 1106 1107 1107 /** 1108 * Test that updating an auto-draft changeset bumps its post_date to keep it from getting garbage collected by wp_delete_auto_drafts(). 1109 * 1110 * @ticket 31089 1111 * @see wp_delete_auto_drafts() 1112 * @covers WP_Customize_Manager::save_changeset_post() 1113 */ 1114 function test_save_changeset_post_dumping_auto_draft_date() { 1115 global $wp_customize; 1116 wp_set_current_user( self::$admin_user_id ); 1117 1118 $uuid = wp_generate_uuid4(); 1119 $changeset_post_id = wp_insert_post( array( 1120 'post_type' => 'customize_changeset', 1121 'post_content' => '{}', 1122 'post_name' => $uuid, 1123 'post_status' => 'auto-draft', 1124 'post_date' => gmdate( 'Y-m-d H:i:s', strtotime( '-3 days' ) ), 1125 ) ); 1126 1127 $post = get_post( $changeset_post_id ); 1128 $original_post_date = $post->post_date; 1129 1130 $wp_customize = $this->create_test_manager( $uuid ); 1131 $wp_customize->save_changeset_post( array( 1132 'status' => 'auto-draft', 1133 'data' => array( 1134 'blogname' => array( 1135 'value' => 'Admin 1 Title', 1136 ), 1137 ), 1138 ) ); 1139 1140 $post = get_post( $changeset_post_id ); 1141 $this->assertNotEquals( $post->post_date, $original_post_date ); 1142 } 1143 1144 /** 1108 1145 * Test writing changesets when user supplies unchanged values. 1109 1146 *
Note: See TracChangeset
for help on using the changeset viewer.