@@ -261,7 +261,10 @@ public function test_setup_metaboxes() {
261
261
$ post_type = $ this ->get_new_post_type_instance ( $ this ->plugin ->customize_snapshot_manager );
262
262
$ post_type ->init ();
263
263
264
- $ post_id = $ this ->factory ()->post ->create ( array ( 'post_type ' => $ this ->post_type_slug , 'post_status ' => 'draft ' ) );
264
+ $ post_id = $ this ->factory ()->post ->create ( array (
265
+ 'post_type ' => $ this ->post_type_slug ,
266
+ 'post_status ' => 'draft ' ,
267
+ ) );
265
268
266
269
$ wp_meta_boxes = array (); // WPCS: global override ok.
267
270
$ metabox_id = $ this ->post_type_slug ;
@@ -542,7 +545,10 @@ public function test_get_post_content() {
542
545
$ this ->assertEquals ( 'baz ' , $ content ['foo ' ]['value ' ] );
543
546
544
547
// Bad post data.
545
- $ bad_post_id = $ this ->factory ()->post ->create ( array ( 'post_type ' => $ this ->post_type_slug , 'post_content ' => 'BADJSON ' ) );
548
+ $ bad_post_id = $ this ->factory ()->post ->create ( array (
549
+ 'post_type ' => $ this ->post_type_slug ,
550
+ 'post_content ' => 'BADJSON ' ,
551
+ ) );
546
552
$ bad_post = get_post ( $ bad_post_id );
547
553
$ content = $ post_type ->get_post_content ( $ bad_post );
548
554
$ this ->assertEquals ( array (), $ content );
@@ -566,17 +572,28 @@ public function test_save() {
566
572
$ this ->assertInstanceOf ( 'WP_Error ' , $ r );
567
573
$ this ->assertEquals ( 'missing_valid_uuid ' , $ r ->get_error_code () );
568
574
569
- $ r = $ post_type ->save ( array ( 'uuid ' => self ::UUID , 'data ' => 'bad ' ) );
575
+ $ r = $ post_type ->save ( array (
576
+ 'uuid ' => self ::UUID ,
577
+ 'data ' => 'bad ' ,
578
+ ) );
570
579
$ this ->assertInstanceOf ( 'WP_Error ' , $ r );
571
580
$ this ->assertEquals ( 'missing_data ' , $ r ->get_error_code () );
572
581
573
582
// Error: bad_setting_params.
574
- $ r = $ post_type ->save ( array ( 'uuid ' => self ::UUID , 'data ' => array ( 'foo ' => 'bar ' ) ) );
583
+ $ r = $ post_type ->save ( array (
584
+ 'uuid ' => self ::UUID ,
585
+ 'data ' => array ( 'foo ' => 'bar ' ),
586
+ ) );
575
587
$ this ->assertInstanceOf ( 'WP_Error ' , $ r );
576
588
$ this ->assertEquals ( 'bad_setting_params ' , $ r ->get_error_code () );
577
589
578
590
// Error: missing_value_param.
579
- $ r = $ post_type ->save ( array ( 'uuid ' => self ::UUID , 'data ' => array ( 'foo ' => array ( 'bar ' => 'quux ' ) ) ) );
591
+ $ r = $ post_type ->save ( array (
592
+ 'uuid ' => self ::UUID ,
593
+ 'data ' => array (
594
+ 'foo ' => array ( 'bar ' => 'quux ' ),
595
+ ),
596
+ ) );
580
597
$ this ->assertInstanceOf ( 'WP_Error ' , $ r );
581
598
$ this ->assertEquals ( 'missing_value_param ' , $ r ->get_error_code () );
582
599
@@ -779,12 +796,14 @@ public function test_add_snapshot_bulk_actions() {
779
796
public function test_handle_snapshot_merge () {
780
797
$ ids = $ this ->factory ()->post ->create_many ( 2 );
781
798
$ posts = array_map ( 'get_post ' , $ ids );
782
- $ post_type_obj = $ this ->getMockBuilder ( 'CustomizeSnapshots\Post_Type ' )
783
- ->setConstructorArgs ( array ( $ this ->plugin ->customize_snapshot_manager ) )
784
- ->setMethods ( array ( 'merge_snapshots ' ) )
785
- ->getMock ();
786
- $ post_type_obj ->expects ( $ this ->once () )
787
- ->method ( 'merge_snapshots ' )
799
+ $ post_type_obj = $ this
800
+ ->getMockBuilder ( 'CustomizeSnapshots\Post_Type ' )
801
+ ->setConstructorArgs ( array ( $ this ->plugin ->customize_snapshot_manager ) )
802
+ ->setMethods ( array ( 'merge_snapshots ' ) )
803
+ ->getMock ();
804
+ $ post_type_obj
805
+ ->expects ( $ this ->once () )
806
+ ->method ( 'merge_snapshots ' )
788
807
->with ( $ posts )
789
808
->will ( $ this ->returnValue ( null ) );
790
809
$ post_type_obj ->handle_snapshot_merge ( '' , 'merge_snapshot ' , $ ids );
0 commit comments