@@ -430,6 +430,7 @@ function test_ajax_update_snapshot_schedule() {
430
430
$ setting_key = 'anyonecanedit ' ;
431
431
$ tomorrow = date ( 'Y-m-d H:i:s ' , time () + 86400 );
432
432
$ this ->set_current_user ( 'administrator ' );
433
+ $ this ->assertTrue ( current_user_can ( 'publish_customize_snapshots ' ) );
433
434
$ this ->set_input_vars ( array (
434
435
'action ' => Customize_Snapshot_Manager::AJAX_ACTION ,
435
436
'nonce ' => wp_create_nonce ( Customize_Snapshot_Manager::AJAX_ACTION ),
@@ -483,12 +484,12 @@ function test_ajax_update_snapshot_ok_for_draft_and_pending_but_not_future() {
483
484
}, 10 , 3 );
484
485
$ tomorrow = date ( 'Y-m-d H:i:s ' , time () + 86400 );
485
486
$ this ->set_current_user ( 'contributor ' );
487
+ $ this ->assertFalse ( current_user_can ( 'publish_customize_snapshots ' ) );
486
488
$ post_vars = array (
487
489
'action ' => Customize_Snapshot_Manager::AJAX_ACTION ,
488
490
'nonce ' => wp_create_nonce ( Customize_Snapshot_Manager::AJAX_ACTION ),
489
491
'customize_snapshot_uuid ' => self ::UUID ,
490
492
'customized ' => wp_json_encode ( array ( $ setting_key => 'Hello ' ) ),
491
- 'status ' => 'draft ' ,
492
493
'publish_date ' => $ tomorrow , // Tomorrow.
493
494
);
494
495
@@ -497,7 +498,7 @@ function test_ajax_update_snapshot_ok_for_draft_and_pending_but_not_future() {
497
498
$ this ->add_setting ();
498
499
499
500
// Draft pass.
500
- $ post_vars ['status ' ] = 'pending ' ;
501
+ $ post_vars ['status ' ] = 'draft ' ;
501
502
$ this ->set_input_vars ( $ post_vars );
502
503
$ this ->make_ajax_call ( Customize_Snapshot_Manager::AJAX_ACTION );
503
504
$ response = json_decode ( $ this ->_last_response , true );
0 commit comments