-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathtest-customizer.php
More file actions
1395 lines (937 loc) · 35.8 KB
/
test-customizer.php
File metadata and controls
1395 lines (937 loc) · 35.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
class Test_Customizer extends WP_UnitTestCase {
function setUp(): void {
parent::setUp();
wp_set_current_user( $this->factory->user->create( [ 'role' => 'administrator' ] ) );
require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' );
global $wp_customize;
$GLOBALS['wp_customize'] = new WP_Customize_Manager();
$GLOBALS['wp_customize']->setup_theme();
$GLOBALS['wp_customize']->register_controls();
require_once get_parent_theme_file_path( 'includes/classes/customizer/class-range-control.php' );
require_once get_parent_theme_file_path( 'includes/classes/customizer/class-switcher-control.php' );
Go\Customizer\setup();
}
function tearDown(): void {
parent::tearDown();
global $wp_customize;
$wp_customize = null;
}
/**
* Test register_control_types is hooked correctly
*/
function test_hooked_register_control_types() {
$this->assertEquals(
10,
has_action( 'customize_register', 'Go\Customizer\register_control_types' ),
'customize_register is not attached to Go\Customizer\register_control_types. It might also have the wrong priority (validated priority: 10)'
);
}
/**
* Test default_controls is hooked correctly
*/
function test_hooked_default_controls() {
$this->assertEquals(
10,
has_action( 'customize_register', 'Go\Customizer\default_controls' ),
'customize_register is not attached to Go\Customizer\default_controls. It might also have the wrong priority (validated priority: 10)'
);
}
/**
* Test register_site_title_controls is hooked correctly
*/
function test_hooked_register_site_title_controls() {
$this->assertEquals(
10,
has_action( 'customize_register', 'Go\Customizer\register_site_title_controls' ),
'customize_register is not attached to Go\Customizer\register_site_title_controls. It might also have the wrong priority (validated priority: 10)'
);
}
/**
* Test register_logo_controls is hooked correctly
*/
function test_hooked_register_logo_controls() {
$this->assertEquals(
10,
has_action( 'customize_register', 'Go\Customizer\register_logo_controls' ),
'customize_register is not attached to Go\Customizer\register_logo_controls. It might also have the wrong priority (validated priority: 10)'
);
}
/**
* Test register_color_controls is hooked correctly
*/
function test_hooked_register_color_controls() {
$this->assertEquals(
10,
has_action( 'customize_register', 'Go\Customizer\register_color_controls' ),
'customize_register is not attached to Go\Customizer\register_color_controls. It might also have the wrong priority (validated priority: 10)'
);
}
/**
* Test register_global_controls is hooked correctly
*/
function test_hooked_register_global_controls() {
$this->assertEquals(
10,
has_action( 'customize_register', 'Go\Customizer\register_global_controls' ),
'customize_register is not attached to Go\Customizer\register_global_controls. It might also have the wrong priority (validated priority: 10)'
);
}
/**
* Test register_header_controls is hooked correctly
*/
function test_hooked_register_header_controls() {
$this->assertEquals(
10,
has_action( 'customize_register', 'Go\Customizer\register_header_controls' ),
'customize_register is not attached to Go\Customizer\register_header_controls. It might also have the wrong priority (validated priority: 10)'
);
}
/**
* Test register_footer_controls is hooked correctly
*/
function test_hooked_register_footer_controls() {
$this->assertEquals(
10,
has_action( 'customize_register', 'Go\Customizer\register_footer_controls' ),
'customize_register is not attached to Go\Customizer\register_footer_controls. It might also have the wrong priority (validated priority: 10)'
);
}
/**
* Test register_social_controls is hooked correctly
*/
function test_hooked_register_social_controls() {
$this->assertEquals(
10,
has_action( 'customize_register', 'Go\Customizer\register_social_controls' ),
'customize_register is not attached to Go\Customizer\register_social_controls. It might also have the wrong priority (validated priority: 10)'
);
}
/**
* Test register_menu_controls is hooked correctly
*/
function test_hooked_register_menu_controls() {
$this->assertEquals(
10,
has_action( 'customize_register', 'Go\Customizer\register_menu_controls' ),
'customize_register is not attached to Go\Customizer\register_menu_controls. It might also have the wrong priority (validated priority: 10)'
);
}
/**
* Test customize_preview_init is hooked correctly to customize_preview_init
*/
function test_hooked_customize_preview_init() {
$this->assertEquals(
10,
has_action( 'customize_preview_init', 'Go\Customizer\customize_preview_init' ),
'customize_preview_init is not attached to Go\Customizer\customize_preview_init. It might also have the wrong priority (validated priority: 10)'
);
}
/**
* Test customize_preview_init is hooked correctly to customize_controls_enqueue_scripts
*/
function test_hooked_scripts_customize_preview_init() {
$this->assertEquals(
10,
has_action( 'customize_controls_enqueue_scripts', 'Go\Customizer\customize_preview_init' ),
'customize_controls_enqueue_scripts is not attached to Go\Customizer\customize_preview_init. It might also have the wrong priority (validated priority: 10)'
);
}
/**
* Test enqueue_controls_assets is hooked correctly
*/
function test_hooked_enqueue_controls_assets() {
$this->assertEquals(
10,
has_action( 'customize_preview_init', 'Go\Customizer\enqueue_controls_assets' ),
'customize_preview_init is not attached to Go\Customizer\enqueue_controls_assets. It might also have the wrong priority (validated priority: 10)'
);
}
/**
* Test the controls are registered correctly
*/
function test_register_control_types_color_scheme_control() {
$manager = new WP_Customize_Manager();
$reflection = new ReflectionClass( $manager );
$instance = $reflection->getProperty( 'registered_control_types' );
$instance->setAccessible( true );
Go\Customizer\register_control_types( $manager );
$expected = [
'Go\Customizer\Switcher_Control',
'Go\Customizer\Range_Control',
'Go\Customizer\Title_Control',
];
$this->assertEquals( $expected, $instance->getValue( $manager ) );
}
/**
* Test the navigation placeholder does not register when not in the customizer
*/
function test_wp_nav_fallback_non_customizer() {
$GLOBALS['wp_customize']->stop_previewing_theme();
$this->assertNull( Go\Customizer\wp_nav_fallback( [] ) );
$GLOBALS['wp_customize']->start_previewing_theme();
}
/**
* Test the registered placeholder navigation outputs correctly
*/
function test_wp_nav_fallback() {
$this->expectOutputRegex( '/Please assign a menu to the Primary menu location/' );
Go\Customizer\wp_nav_fallback( [
'theme_location' => 'primary',
'customize_preview_nav_menus_args' => [
'args_hmac' => '123',
],
] );
}
/**
* Test the registered placeholder navigation outputs correctly
*/
function test_wp_nav_register_fallback() {
$this->assertEquals(
[
'theme_location' => 'primary',
'customize_preview_nav_menus_args' => [
'args_hmac' => '123',
],
'fallback_cb' => 'Go\Customizer\wp_nav_fallback',
],
Go\Customizer\wp_nav_register_fallback( [
'theme_location' => 'primary',
'customize_preview_nav_menus_args' => [
'args_hmac' => '123',
],
] )
);
}
/**
* Test the blogname transport is set properly
*/
function test_default_controls_blogname_transport() {
Go\Customizer\default_controls( $GLOBALS['wp_customize'] );
$this->assertEquals( 'postMessage', $GLOBALS['wp_customize']->get_setting( 'blogname' )->transport );
}
/**
* Test the blogdescription transport is set properly
*/
function test_default_controls_blogdescription_transport() {
Go\Customizer\default_controls( $GLOBALS['wp_customize'] );
$this->assertEquals( 'postMessage', $GLOBALS['wp_customize']->get_setting( 'blogdescription' )->transport );
}
/**
* Test the custom_logo transport is set properly
*/
function test_default_controls_custom_logo_transport() {
Go\Customizer\default_controls( $GLOBALS['wp_customize'] );
$this->assertEquals( 'postMessage', $GLOBALS['wp_customize']->get_setting( 'custom_logo' )->transport );
}
/**
* Test the blogname partial is exported
*/
function test_default_controls_blogname_partial() {
Go\Customizer\default_controls( $GLOBALS['wp_customize'] );
$GLOBALS['wp_customize']->selective_refresh->export_preview_data();
$this->expectOutputRegex( '/_customizePartialRefreshExports =(.*?)"blogname":{"settings":\["blogname"\],"primarySetting":"blogname","selector":".header__titles","type":"default","fallbackRefresh":true,"containerInclusive":false}/' );
}
/**
* Test the blogdescription partial is exported
*/
function test_default_controls_blogdescription_partial() {
Go\Customizer\default_controls( $GLOBALS['wp_customize'] );
$GLOBALS['wp_customize']->selective_refresh->export_preview_data();
$this->expectOutputRegex( '/_customizePartialRefreshExports =(.*?)"blogdescription":{"settings":\["blogdescription"\],"primarySetting":"blogdescription","selector":".header__titles","type":"default","fallbackRefresh":true,"containerInclusive":false}/' );
}
/**
* Test the custom_logo partial is exported
*/
function test_default_controls_custom_logo_partial() {
Go\Customizer\default_controls( $GLOBALS['wp_customize'] );
$GLOBALS['wp_customize']->selective_refresh->export_preview_data();
$this->expectOutputRegex( '/_customizePartialRefreshExports =(.*?)"custom_logo":{"settings":\["custom_logo"\],"primarySetting":"custom_logo","selector":".header__titles","type":"default","fallbackRefresh":true,"containerInclusive":false}/' );
}
/**
* Test the background_image section is removed
*/
function test_default_controls_remove_background_image() {
Go\Customizer\default_controls( $GLOBALS['wp_customize'] );
$this->assertNull( $GLOBALS['wp_customize']->get_section( 'background_image' ) );
}
/**
* Test the scripts are enqueued on customize_preview_init
*/
function test_customize_preview_init() {
Go\Customizer\customize_preview_init();
$this->assertTrue(
wp_script_is( 'go-customize-preview' ),
'go-customize-preview script is not enqueued'
);
}
/**
* Test the block editor assets data is localized
*/
function test_customize_preview_init_go_customize_preview_localized_data() {
Go\Customizer\customize_preview_init();
global $wp_scripts;
$this->assertStringContainsString( 'var GoPreviewData = {"design_styles"', $wp_scripts->registered['go-customize-preview']->extra['data'] );
}
/**
* Test the control assets are enqueued
*/
function test_enqueue_controls_assets() {
Go\Customizer\enqueue_controls_assets();
$script_handles = [
'go-customize-controls',
];
$style_handles = [
'go-customize-style',
];
foreach ( $script_handles as $script_handle ) {
if ( ! wp_script_is( $script_handle ) ) {
$this->fail( "The script '{$script_handle}' was not enqueued." );
}
}
foreach ( $style_handles as $style_handle ) {
if ( ! wp_style_is( $style_handle ) ) {
$this->fail( "The style '{$style_handle}' was not enqueued." );
}
}
$this->assertTrue( true );
}
/**
* Test color scheme choices return as expected
*/
function test_get_color_schemes_as_choices() {
$expected_color_scheme_keys = [
'traditional-one',
'traditional-two',
'traditional-three',
'traditional-four',
'modern-one',
'modern-two',
'modern-three',
'modern-four',
'trendy-one',
'trendy-two',
'trendy-three',
'trendy-four',
'welcoming-one',
'welcoming-two',
'welcoming-three',
'welcoming-four',
'playful-one',
'playful-two',
'playful-three',
'playful-four',
];
$this->assertEquals( $expected_color_scheme_keys, array_keys( Go\Customizer\get_color_schemes_as_choices() ) );
}
/**
* Test color scheme choices return as expected after being filtered
*/
function test_get_color_schemes_as_choices_filtered() {
add_filter( 'go_design_styles', function( $default_design_styles ) {
unset( $default_design_styles['traditional']['color_schemes']['one'] );
return $default_design_styles;
} );
$expected_color_scheme_keys = [
'traditional-two',
'traditional-three',
'traditional-four',
'modern-one',
'modern-two',
'modern-three',
'modern-four',
'trendy-one',
'trendy-two',
'trendy-three',
'trendy-four',
'welcoming-one',
'welcoming-two',
'welcoming-three',
'welcoming-four',
'playful-one',
'playful-two',
'playful-three',
'playful-four',
];
$this->assertEquals( $expected_color_scheme_keys, array_keys( Go\Customizer\get_color_schemes_as_choices() ) );
}
/**
* Test the logo_width settings are registered
*/
function test_register_logo_controls_logo_width_setting() {
Go\Customizer\register_logo_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_setting( 'logo_width' ) );
}
/**
* Test the logo_width controls are registered
*/
function test_register_logo_controls_logo_width_control() {
Go\Customizer\register_logo_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_control( 'logo_width' ) );
}
/**
* Test the logo_width_mobile settings are registered
*/
function test_register_logo_controls_logo_width_mobile_setting() {
Go\Customizer\register_logo_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_setting( 'logo_width_mobile' ) );
}
/**
* Test the logo_width_mobile controls are registered
*/
function test_register_logo_controls_logo_width_mobile_control() {
Go\Customizer\register_logo_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_control( 'logo_width_mobile' ) );
}
/**
* Test the hide_site_title setting is registered
*/
function test_register_site_title_controls_hide_site_title() {
Go\Customizer\register_site_title_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_setting( 'hide_site_title' ) );
}
/**
* Test the hide_site_title control is registered
*/
function test_register_site_title_controls_hide_site_title_control() {
Go\Customizer\register_site_title_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_control( 'hide_site_title_checkbox' ) );
}
/**
* Test the hide_site_tagline setting is registered
*/
function test_register_site_title_controls_hide_site_tagline() {
Go\Customizer\register_site_title_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_setting( 'hide_site_tagline' ) );
}
/**
* Test the hide_site_tagline control is registered
*/
function test_register_site_title_controls_hide_site_tagline_control() {
Go\Customizer\register_site_title_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_control( 'hide_site_tagline_checkbox' ) );
}
/**
* Test the hide_site_tagline control is registered
*/
function test_site_title_control_priorities() {
Go\Customizer\register_site_title_controls( $GLOBALS['wp_customize'] );
$expected_priorites = [
'hide_site_title_checkbox' => 10,
'blogdescription' => 11,
'hide_site_tagline_checkbox' => 12,
];
$current_priorites = [
'hide_site_title_checkbox' => $GLOBALS['wp_customize']->get_control( 'hide_site_title_checkbox' )->priority,
'blogdescription' => $GLOBALS['wp_customize']->get_control( 'blogdescription' )->priority,
'hide_site_tagline_checkbox' => $GLOBALS['wp_customize']->get_control( 'hide_site_tagline_checkbox' )->priority,
];
$this->assertEquals( $expected_priorites, $current_priorites );
}
/**
* Test the go_site_settings section is registered
*/
function test_register_global_controls_go_site_settings_section() {
Go\Customizer\register_global_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_section( 'go_site_settings' ) );
}
/**
* Test the page_titles setting is registered
*/
function test_register_global_controls_page_titles_setting() {
Go\Customizer\register_global_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_setting( 'page_titles' ) );
}
/**
* Test the show_page_title_checkbox control is registered
*/
function test_register_global_controls_show_page_title_checkbox_control() {
Go\Customizer\register_global_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_control( 'show_page_title_checkbox' ) );
}
/**
* Test the blog_excerpt setting is registered
*/
function test_register_global_controls_blog_excerpt_setting() {
Go\Customizer\register_global_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_setting( 'blog_excerpt' ) );
}
/**
* Test the blog_excerpt_checkbox control is registered
*/
function test_register_global_controls_blog_excerpt_checkbox_control() {
Go\Customizer\register_global_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_control( 'blog_excerpt_checkbox' ) );
}
/**
* Test the copyright setting is registered
*/
function test_register_global_controls_copyright_setting() {
Go\Customizer\register_global_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_setting( 'copyright' ) );
}
/**
* Test the copyright_control control is registered
*/
function test_register_global_controls_copyright_control() {
Go\Customizer\register_global_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_control( 'copyright_control' ) );
}
/**
* Test the copyright kses HTML returns expected HTML elements.
*/
function test_copyright_kses_html() {
$this->assertEquals( 'This is a test <a href="#">Test</a>', Go\Customizer\copyright_kses_html( 'This is a test <a href="#">Test</a>' ) );
}
/**
* Test the design_style setting is registered
*/
function test_register_color_controls_design_style_setting() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_setting( 'design_style' ) );
}
/**
* Test the design_style_control control is registered
*/
function test_register_color_controls_design_style_control() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_control( 'design_style_control' ) );
}
/**
* Test the color_scheme setting is registered
*/
function test_register_color_controls_color_scheme_setting() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_setting( 'color_scheme' ) );
}
/**
* Test the color_scheme_control control is registered
*/
function test_register_color_controls_color_scheme_control() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_control( 'color_scheme_control' ) );
}
/**
* Test the primary_color setting is registered
*/
function test_register_color_controls_primary_color_setting() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_setting( 'primary_color' ) );
}
/**
* Test the primary_color_control control is registered
*/
function test_register_color_controls_primary_color_control() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_control( 'primary_color_control' ) );
}
/**
* Test the secondary_color setting is registered
*/
function test_register_color_controls_secondary_color_setting() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_setting( 'secondary_color' ) );
}
/**
* Test the secondary_color_control control is registered
*/
function test_register_color_controls_secondary_color_control() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_control( 'secondary_color_control' ) );
}
/**
* Test the tertiary_color setting is registered
*/
function test_register_color_controls_tertiary_color_setting() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_setting( 'tertiary_color' ) );
}
/**
* Test the tertiary_color_control control is registered
*/
function test_register_color_controls_tertiary_color_control() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_control( 'tertiary_color_control' ) );
}
/**
* Test the title_header_colors setting is registered
*/
function test_register_header_controls_title_header_colors_setting() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_setting( 'title_header_colors' ) );
}
/**
* Test the title_header_colors control is registered
*/
function test_register_header_controls_title_header_colors_control() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_control( 'title_header_colors' ) );
}
/**
* Test the header_background_color setting is registered
*/
function test_register_color_controls_header_background_color_setting() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_setting( 'header_background_color' ) );
}
/**
* Test the tertiary_color_control control is registered
*/
function test_register_color_controls_header_background_color_control() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_control( 'header_background_color' ) );
}
/**
* Test the header_text_color setting is registered
*/
function test_register_header_controls_header_text_color_setting() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_setting( 'header_text_color' ) );
}
/**
* Test the header_text_color_control control is registered
*/
function test_register_header_controls_header_text_color_control() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_control( 'header_text_color' ) );
}
/**
* Test the title_footer_colors setting is registered
*/
function test_register_header_controls_title_footer_colors_setting() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_setting( 'title_footer_colors' ) );
}
/**
* Test the title_footer_colors_control control is registered
*/
function test_register_header_controls_title_footer_colors_control() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_control( 'title_footer_colors' ) );
}
/**
* Test the footer_background_color setting is registered
*/
function test_register_header_controls_footer_background_color_setting() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_setting( 'footer_background_color' ) );
}
/**
* Test the footer_background_color_control control is registered
*/
function test_register_header_controls_footer_background_color_control() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_control( 'footer_background_color' ) );
}
/**
* Test the footer_text_color setting is registered
*/
function test_register_footer_controls_footer_text_color_setting() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_setting( 'footer_text_color' ) );
}
/**
* Test the footer_text_color control is registered
*/
function test_register_footer_controls_footer_text_color_control() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_control( 'footer_text_color' ) );
}
/**
* Test the footer_heading_color setting is registered
*/
function test_register_footer_controls_footer_heading_color_setting() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_setting( 'footer_heading_color' ) );
}
/**
* Test the footer_heading_color control is registered
*/
function test_register_footer_controls_footer_heading_color_control() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_control( 'footer_heading_color' ) );
}
/**
* Test the social_icon_color setting is registered
*/
function test_register_color_controls_social_icon_color_setting() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_setting( 'social_icon_color' ) );
}
/**
* Test the social_icon_color control is registered
*/
function test_register_color_controls_social_icon_color_control() {
Go\Customizer\register_color_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_control( 'social_icon_color' ) );
}
/**
* Test the go_header_settings section is registered
*/
function test_register_header_controls_go_site_settings_section() {
Go\Customizer\register_header_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_section( 'go_header_settings' ) );
}
/**
* Test the header_variation setting is registered
*/
function test_register_header_controls_header_variation_setting() {
Go\Customizer\register_header_controls( $GLOBALS['wp_customize'] );
$this->assertNotNull( $GLOBALS['wp_customize']->get_setting( 'header_variation' ) );