Changeset 43571 for trunk/tests/phpunit/tests/customize/manager.php
- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/manager.php
r42863 r43571 551 551 552 552 $existing_canola_attachment_id = self::factory()->attachment->create_object( 553 $this->test_file, 0, array( 553 $this->test_file, 554 0, 555 array( 554 556 'post_mime_type' => 'image/jpeg', 555 557 'post_type' => 'attachment', … … 986 988 $previous_saved_data = $saved_data; 987 989 $manager->add_setting( 988 'foo_unauthorized', array( 990 'foo_unauthorized', 991 array( 989 992 'capability' => 'do_not_allow', 990 993 ) 991 994 ); 992 995 $manager->add_setting( 993 'baz_illegal', array( 996 'baz_illegal', 997 array( 994 998 'validate_callback' => array( $this, 'return_illegal_error' ), 995 999 ) … … 1099 1103 do_action( 'customize_register', $wp_customize ); 1100 1104 $manager->add_setting( 1101 'scratchpad', array( 1105 'scratchpad', 1106 array( 1102 1107 'type' => 'option', 1103 1108 'capability' => 'exist', … … 1383 1388 do_action( 'customize_register', $manager ); 1384 1389 $manager->add_setting( 1385 'blogfounded', array( 1390 'blogfounded', 1391 array( 1386 1392 'type' => 'option', 1387 1393 ) 1388 1394 ); 1389 1395 $manager->add_setting( 1390 'blogterminated', array( 1396 'blogterminated', 1397 array( 1391 1398 'type' => 'option', 1392 1399 'capability' => 'do_not_allow', … … 1394 1401 ); 1395 1402 $manager->add_setting( 1396 'scratchpad', array( 1403 'scratchpad', 1404 array( 1397 1405 'type' => 'option', 1398 1406 'capability' => 'exist', … … 1899 1907 function register_scratchpad_setting( WP_Customize_Manager $wp_customize ) { 1900 1908 $wp_customize->add_setting( 1901 'scratchpad', array( 1909 'scratchpad', 1910 array( 1902 1911 'type' => 'option', 1903 1912 'capability' => 'exist', … … 2195 2204 $default_value = 'foo_default'; 2196 2205 $setting = $this->manager->add_setting( 2197 'foo', array( 2206 'foo', 2207 array( 2198 2208 'validate_callback' => array( $this, 'filter_customize_validate_foo' ), 2199 2209 'sanitize_callback' => array( $this, 'filter_customize_sanitize_foo' ), … … 2263 2273 $default_value = '0'; 2264 2274 $setting = $this->manager->add_setting( 2265 'numeric', array( 2275 'numeric', 2276 array( 2266 2277 'validate_callback' => array( $this, 'filter_customize_validate_numeric' ), 2267 2278 'sanitize_callback' => array( $this, 'filter_customize_sanitize_numeric' ), … … 2309 2320 wp_set_current_user( self::$admin_user_id ); 2310 2321 $setting = $this->manager->add_setting( 2311 'foo', array( 2322 'foo', 2323 array( 2312 2324 'validate_callback' => array( $this, 'filter_customize_validate_foo' ), 2313 2325 'sanitize_callback' => array( $this, 'filter_customize_sanitize_foo' ), … … 2434 2446 wp_set_current_user( self::$admin_user_id ); 2435 2447 $setting = $this->manager->add_setting( 2436 'numeric', array( 2448 'numeric', 2449 array( 2437 2450 'validate_callback' => array( $this, 'filter_customize_validate_numeric' ), 2438 2451 'sanitize_callback' => array( $this, 'filter_customize_sanitize_numeric' ), … … 2478 2491 wp_set_current_user( self::$admin_user_id ); 2479 2492 $this->manager->add_setting( 2480 'foo', array( 2493 'foo', 2494 array( 2481 2495 'sanitize_callback' => array( $this, 'sanitize_foo_for_test_set_post_value' ), 2482 2496 ) … … 2971 2985 wp_set_current_user( self::$admin_user_id ); 2972 2986 $manager->add_section( 2973 $section_id, array( 2987 $section_id, 2988 array( 2974 2989 'title' => 'Section', 2975 2990 'priority' => 1, … … 2984 2999 $manager->add_setting( $id ); 2985 3000 $control = new WP_Customize_Control( 2986 $manager, $id, array( 3001 $manager, 3002 $id, 3003 array( 2987 3004 'section' => $section_id, 2988 3005 'priority' => 1, … … 3008 3025 $section_id = 'foo-section'; 3009 3026 $result_section = $manager->add_section( 3010 $section_id, array( 3027 $section_id, 3028 array( 3011 3029 'title' => 'Section', 3012 3030 'priority' => 1, … … 3018 3036 3019 3037 $section = new WP_Customize_Section( 3020 $manager, $section_id, array( 3038 $manager, 3039 $section_id, 3040 array( 3021 3041 'title' => 'Section 2', 3022 3042 'priority' => 2, … … 3110 3130 $panel_id = 'foo-panel'; 3111 3131 $result_panel = $manager->add_panel( 3112 $panel_id, array( 3132 $panel_id, 3133 array( 3113 3134 'title' => 'Test Panel', 3114 3135 'priority' => 2, … … 3120 3141 3121 3142 $panel = new WP_Customize_Panel( 3122 $manager, $panel_id, array( 3143 $manager, 3144 $panel_id, 3145 array( 3123 3146 'title' => 'Test Panel 2', 3124 3147 ) … … 3139 3162 wp_set_current_user( self::$admin_user_id ); 3140 3163 $manager->add_section( 3141 $section_id, array( 3164 $section_id, 3165 array( 3142 3166 'title' => 'Section', 3143 3167 'priority' => 1, … … 3149 3173 3150 3174 $result_control = $manager->add_control( 3151 $control_id, array( 3175 $control_id, 3176 array( 3152 3177 'section' => $section_id, 3153 3178 'priority' => 1, … … 3159 3184 3160 3185 $control = new WP_Customize_Control( 3161 $manager, $control_id, array( 3186 $manager, 3187 $control_id, 3188 array( 3162 3189 'section' => $section_id, 3163 3190 'priority' => 1, … … 3254 3281 $this->manager->add_setting( $control_id ); 3255 3282 $this->manager->add_control( 3256 $control_id, array( 3283 $control_id, 3284 array( 3257 3285 'priority' => $priority, 3258 3286 'section' => 'foosection', … … 3283 3311 foreach ( $sections as $section_id => $priority ) { 3284 3312 $this->manager->add_section( 3285 $section_id, array( 3313 $section_id, 3314 array( 3286 3315 'priority' => $priority, 3287 3316 ) … … 3311 3340 foreach ( $panels as $panel_id => $priority ) { 3312 3341 $this->manager->add_panel( 3313 $panel_id, array( 3342 $panel_id, 3343 array( 3314 3344 'priority' => $priority, 3315 3345 )
Note: See TracChangeset
for help on using the changeset viewer.