@@ -202,13 +202,13 @@ function test_filter_post_row_actions_draft() {
202
202
$ _POST = array (
203
203
'nonce ' => wp_create_nonce ( 'save-customize_ ' . $ this ->wp_customize ->get_stylesheet () ),
204
204
'snapshot_uuid ' => self ::UUID ,
205
- 'snapshot_customized ' => '{"foo":{"value":"foo_default","dirty":true },"bar":{"value":"bar_default","dirty":true }} ' ,
205
+ 'snapshot_customized ' => '{"foo":{"value":"foo_default"},"bar":{"value":"bar_default"}} ' ,
206
206
);
207
207
208
208
$ manager = new Customize_Snapshot_Manager ( $ this ->plugin );
209
209
$ manager ->capture_unsanitized_snapshot_post_data ();
210
210
$ foo = $ manager ->customize_manager ->get_setting ( 'foo ' );
211
- $ manager ->snapshot ()->set ( $ foo , 'foo_custom ' , true );
211
+ $ manager ->snapshot ()->set ( $ foo , 'foo_custom ' );
212
212
$ manager ->snapshot ()->save ();
213
213
$ actions = array (
214
214
'inline hide-if-no-js ' => true ,
@@ -230,7 +230,7 @@ function test_filter_post_row_actions_publish() {
230
230
$ _POST = array (
231
231
'nonce ' => wp_create_nonce ( 'save-customize_ ' . $ this ->wp_customize ->get_stylesheet () ),
232
232
'snapshot_uuid ' => self ::UUID ,
233
- 'snapshot_customized ' => '{"foo":{"value":"foo_default","dirty":true },"bar":{"value":"bar_default","dirty":true }} ' ,
233
+ 'snapshot_customized ' => '{"foo":{"value":"foo_default"},"bar":{"value":"bar_default"}} ' ,
234
234
);
235
235
$ manager = new Customize_Snapshot_Manager ( $ this ->plugin );
236
236
$ manager ->set_snapshot_uuid ();
@@ -264,7 +264,7 @@ function test_setup_metaboxes() {
264
264
function test_render_data_metabox () {
265
265
wp_set_current_user ( $ this ->user_id );
266
266
$ this ->do_customize_boot_actions ( true );
267
- $ snapshot_json = '{"foo":{"value":"foo_value","dirty":true," sanitized":false}} ' ;
267
+ $ snapshot_json = '{"foo":{"value":"foo_value","sanitized":false}} ' ;
268
268
$ _POST = array (
269
269
'nonce ' => wp_create_nonce ( 'save-customize_ ' . $ this ->wp_customize ->get_stylesheet () ),
270
270
'snapshot_uuid ' => self ::UUID ,
@@ -273,7 +273,7 @@ function test_render_data_metabox() {
273
273
$ manager = new Customize_Snapshot_Manager ( $ this ->plugin );
274
274
$ manager ->capture_unsanitized_snapshot_post_data ();
275
275
$ foo = $ manager ->customize_manager ->get_setting ( 'foo ' );
276
- $ manager ->snapshot ()->set ( $ foo , 'foo_value ' , true );
276
+ $ manager ->snapshot ()->set ( $ foo , 'foo_value ' );
277
277
$ manager ->snapshot ()->save ();
278
278
$ post = $ manager ->snapshot ()->post ();
279
279
ob_start ();
@@ -290,7 +290,7 @@ function test_render_data_metabox() {
290
290
function test_get_post_content () {
291
291
wp_set_current_user ( $ this ->user_id );
292
292
$ this ->do_customize_boot_actions ( true );
293
- $ snapshot_json = '{"foo":{"value":"foo_value","dirty":true," sanitized":false}} ' ;
293
+ $ snapshot_json = '{"foo":{"value":"foo_value","sanitized":false}} ' ;
294
294
$ _POST = array (
295
295
'nonce ' => wp_create_nonce ( 'save-customize_ ' . $ this ->wp_customize ->get_stylesheet () ),
296
296
'snapshot_uuid ' => self ::UUID ,
@@ -299,14 +299,14 @@ function test_get_post_content() {
299
299
$ manager = new Customize_Snapshot_Manager ( $ this ->plugin );
300
300
$ manager ->capture_unsanitized_snapshot_post_data ();
301
301
$ foo = $ manager ->customize_manager ->get_setting ( 'foo ' );
302
- $ manager ->snapshot ()->set ( $ foo , 'foo_value ' , true );
302
+ $ manager ->snapshot ()->set ( $ foo , 'foo_value ' );
303
303
$ manager ->snapshot ()->save ();
304
304
$ post = $ manager ->snapshot ()->post ();
305
305
$ snapshot_content = Customize_Snapshot_Manager::get_post_content ( $ post );
306
306
$ this ->assertEquals ( json_decode ( $ snapshot_json , true ), $ snapshot_content );
307
307
308
308
// Get the revision post.
309
- $ manager ->snapshot ()->set ( $ foo , 'foo_revision_value ' , true );
309
+ $ manager ->snapshot ()->set ( $ foo , 'foo_revision_value ' );
310
310
$ manager ->snapshot ()->save ();
311
311
$ revisions = wp_get_post_revisions ( $ post ->ID );
312
312
$ revision = array_shift ( $ revisions );
@@ -334,11 +334,10 @@ function test_encode_json() {
334
334
$ array = array (
335
335
'foo ' => array (
336
336
'value ' => 'foo_value ' ,
337
- 'dirty ' => true ,
338
337
'sanitized ' => false ,
339
338
),
340
339
);
341
- $ json = '{"foo":{"value":"foo_value","dirty":true," sanitized":false}} ' ;
340
+ $ json = '{"foo":{"value":"foo_value","sanitized":false}} ' ;
342
341
$ this ->assertEquals ( $ json , preg_replace ( '/\s+/ ' , '' , Customize_Snapshot_Manager::encode_json ( $ array ) ) );
343
342
}
344
343
@@ -353,7 +352,7 @@ function test_enqueue_scripts() {
353
352
$ _POST = array (
354
353
'nonce ' => wp_create_nonce ( 'save-customize_ ' . $ this ->wp_customize ->get_stylesheet () ),
355
354
'snapshot_uuid ' => self ::UUID ,
356
- 'snapshot_customized ' => '{"foo":{"value":"foo_default","dirty":false },"bar":{"value":"bar_default","dirty":false }} ' ,
355
+ 'snapshot_customized ' => '{"foo":{"value":"foo_default"},"bar":{"value":"bar_default"}} ' ,
357
356
);
358
357
$ manager = new Customize_Snapshot_Manager ( $ this ->plugin );
359
358
$ manager ->set_snapshot_uuid ();
@@ -387,7 +386,7 @@ function test_save_error() {
387
386
$ _POST = array (
388
387
'nonce ' => wp_create_nonce ( 'save-customize_ ' . $ this ->wp_customize ->get_stylesheet () ),
389
388
'snapshot_uuid ' => self ::UUID ,
390
- 'snapshot_customized ' => '{"baz":{"value":"","dirty":true }} ' ,
389
+ 'snapshot_customized ' => '{"baz":{"value":""}} ' ,
391
390
);
392
391
$ manager = new Customize_Snapshot_Manager ( $ this ->plugin );
393
392
$ manager ->save ();
@@ -403,7 +402,7 @@ function test_save_snapshot() {
403
402
$ _POST = array (
404
403
'nonce ' => wp_create_nonce ( 'save-customize_ ' . $ this ->wp_customize ->get_stylesheet () ),
405
404
'snapshot_uuid ' => self ::UUID ,
406
- 'snapshot_customized ' => '{"foo":{"value":"foo_default","dirty":false },"bar":{"value":"bar_default","dirty":false }} ' ,
405
+ 'snapshot_customized ' => '{"foo":{"value":"foo_default"},"bar":{"value":"bar_default"}} ' ,
407
406
);
408
407
$ manager = new Customize_Snapshot_Manager ( $ this ->plugin );
409
408
$ manager ->set_snapshot_uuid ();
@@ -465,7 +464,7 @@ public function test_can_preview() {
465
464
$ _POST = wp_slash ( array (
466
465
'nonce ' => wp_create_nonce ( 'save-customize_ ' . $ this ->wp_customize ->get_stylesheet () ),
467
466
'snapshot_uuid ' => self ::UUID ,
468
- 'snapshot_customized ' => '{"foo":{"value":"foo_custom","dirty":true },"bar":{"value":"bar_default","dirty":false }} ' ,
467
+ 'snapshot_customized ' => '{"foo":{"value":"foo_custom"},"bar":{"value":"bar_default"}} ' ,
469
468
) );
470
469
$ this ->do_customize_boot_actions ( true );
471
470
$ foo = $ this ->wp_customize ->get_setting ( 'foo ' );
@@ -503,7 +502,7 @@ public function test_can_preview_array_key_exists() {
503
502
$ _POST = array (
504
503
'nonce ' => wp_create_nonce ( 'save-customize_ ' . $ this ->wp_customize ->get_stylesheet () ),
505
504
'snapshot_uuid ' => self ::UUID ,
506
- 'snapshot_customized ' => '{"bar":{"value":"bar_default","dirty":false }} ' ,
505
+ 'snapshot_customized ' => '{"bar":{"value":"bar_default"}} ' ,
507
506
);
508
507
$ manager = new Customize_Snapshot_Manager ( $ this ->plugin );
509
508
$ manager ->save_snapshot ();
@@ -520,7 +519,7 @@ public function test_can_preview_array_key_exists() {
520
519
public function test_set_post_values () {
521
520
wp_set_current_user ( $ this ->user_id );
522
521
$ foo = $ this ->manager ->customize_manager ->get_setting ( 'foo ' );
523
- $ this ->manager ->snapshot ()->set ( $ foo , 'foo_custom ' , true );
522
+ $ this ->manager ->snapshot ()->set ( $ foo , 'foo_custom ' );
524
523
$ this ->manager ->snapshot ()->save ();
525
524
$ this ->manager ->snapshot ()->is_preview = true ;
526
525
$ this ->manager ->set_post_values ();
@@ -535,7 +534,7 @@ public function test_preview() {
535
534
$ this ->manager ->customize_manager = $ this ->wp_customize ;
536
535
$ this ->manager ->snapshot = new Customize_Snapshot ( $ this ->manager , null );
537
536
$ foo = $ this ->manager ->customize_manager ->get_setting ( 'foo ' );
538
- $ this ->manager ->snapshot ()->set ( $ foo , 'foo_custom ' , true );
537
+ $ this ->manager ->snapshot ()->set ( $ foo , 'foo_custom ' );
539
538
$ this ->assertFalse ( $ foo ->dirty );
540
539
$ this ->manager ->snapshot ()->save ();
541
540
$ this ->manager ->snapshot ()->is_preview = true ;
@@ -553,8 +552,8 @@ public function test_excerpt() {
553
552
$ this ->manager ->snapshot = new Customize_Snapshot ( $ this ->manager , null );
554
553
$ foo = $ this ->manager ->customize_manager ->get_setting ( 'foo ' );
555
554
$ bar = $ this ->manager ->customize_manager ->get_setting ( 'bar ' );
556
- $ this ->manager ->snapshot ()->set ( $ foo , 'foo_custom ' , true );
557
- $ this ->manager ->snapshot ()->set ( $ bar , 'bar_custom ' , true );
555
+ $ this ->manager ->snapshot ()->set ( $ foo , 'foo_custom ' );
556
+ $ this ->manager ->snapshot ()->set ( $ bar , 'bar_custom ' );
558
557
$ this ->manager ->snapshot ()->save ();
559
558
560
559
$ post = $ this ->manager ->snapshot ()->post ();
0 commit comments