Changeset 52010 for trunk/tests/phpunit/tests/customize/setting.php
- Timestamp:
- 11/04/2021 03:22:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/setting.php
r51568 r52010 18 18 public $undefined; 19 19 20 function set_up() {20 public function set_up() { 21 21 parent::set_up(); 22 22 require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; … … 26 26 } 27 27 28 function tear_down() {28 public function tear_down() { 29 29 $this->manager = null; 30 30 unset( $GLOBALS['wp_customize'] ); … … 32 32 } 33 33 34 function test_constructor_without_args() {34 public function test_constructor_without_args() { 35 35 $setting = new WP_Customize_Setting( $this->manager, 'foo' ); 36 36 $this->assertSame( $this->manager, $setting->manager ); … … 85 85 * @param WP_Customize_Setting $setting The setting object. 86 86 */ 87 function sanitize_js_callback_base64_for_testing( $value, $setting ) {87 public function sanitize_js_callback_base64_for_testing( $value, $setting ) { 88 88 return base64_encode( $value ); 89 89 } 90 90 91 function test_constructor_with_args() {91 public function test_constructor_with_args() { 92 92 $args = array( 93 93 'type' => 'option', … … 137 137 * @see WP_Customize_Setting::value() 138 138 */ 139 function test_preview_standard_types_non_multidimensional() {139 public function test_preview_standard_types_non_multidimensional() { 140 140 wp_set_current_user( $this->factory()->user->create( array( 'role' => 'administrator' ) ) ); 141 141 $_POST['customized'] = wp_slash( wp_json_encode( $this->post_data_overrides ) ); … … 216 216 * @see WP_Customize_Setting::value() 217 217 */ 218 function test_preview_standard_types_multidimensional() {218 public function test_preview_standard_types_multidimensional() { 219 219 wp_set_current_user( $this->factory()->user->create( array( 'role' => 'administrator' ) ) ); 220 220 $_POST['customized'] = wp_slash( wp_json_encode( $this->post_data_overrides ) ); … … 317 317 protected $custom_type_data_previewed; 318 318 319 function custom_type_getter( $name, $default = null ) {319 private function custom_type_getter( $name, $default = null ) { 320 320 if ( did_action( "customize_preview_{$name}" ) && array_key_exists( $name, $this->custom_type_data_previewed ) ) { 321 321 $value = $this->custom_type_data_previewed[ $name ]; … … 328 328 } 329 329 330 function custom_type_setter( $name, $value ) {330 private function custom_type_setter( $name, $value ) { 331 331 $this->custom_type_data_saved[ $name ] = $value; 332 332 } … … 340 340 * @return mixed|null 341 341 */ 342 function custom_type_value_filter( $default, $setting = null ) {342 public function custom_type_value_filter( $default, $setting = null ) { 343 343 $name = preg_replace( '/^customize_value_/', '', current_filter() ); 344 344 $this->assertInstanceOf( 'WP_Customize_Setting', $setting ); … … 351 351 * @param WP_Customize_Setting $setting 352 352 */ 353 function custom_type_preview( $setting ) {353 public function custom_type_preview( $setting ) { 354 354 $previewed_value = $setting->post_value( $this->undefined ); 355 355 if ( $this->undefined !== $previewed_value ) { … … 362 362 * @see WP_Customize_Setting::preview() 363 363 */ 364 function test_preview_custom_type() {364 public function test_preview_custom_type() { 365 365 wp_set_current_user( $this->factory()->user->create( array( 'role' => 'administrator' ) ) ); 366 366 $type = 'custom_type'; … … 474 474 * @ticket 30988 475 475 */ 476 function test_non_posted_setting_applying_default_value_in_preview() {476 public function test_non_posted_setting_applying_default_value_in_preview() { 477 477 $type = 'option'; 478 478 $name = 'unset_option_without_post_value'; … … 492 492 * @see WP_Customize_Setting::update() 493 493 */ 494 function test_update_custom_type() {494 public function test_update_custom_type() { 495 495 $type = 'custom'; 496 496 $name = 'foo'; … … 527 527 * @param WP_Customize_Setting $setting 528 528 */ 529 function handle_customize_update_custom_foo_action( $value, $setting = null ) {529 public function handle_customize_update_custom_foo_action( $value, $setting = null ) { 530 530 $this->assertSame( 'hello world \\o/', $value ); 531 531 $this->assertInstanceOf( 'WP_Customize_Setting', $setting ); … … 538 538 * @param WP_Customize_Setting $setting 539 539 */ 540 function handle_customize_save_custom_foo_action( $setting ) {540 public function handle_customize_save_custom_foo_action( $setting ) { 541 541 $this->assertInstanceOf( 'WP_Customize_Setting', $setting ); 542 542 $this->assertSame( 'custom', $setting->type ); … … 551 551 * @ticket 31428 552 552 */ 553 function test_is_current_blog_previewed() {553 public function test_is_current_blog_previewed() { 554 554 wp_set_current_user( $this->factory()->user->create( array( 'role' => 'administrator' ) ) ); 555 555 $type = 'option'; … … 573 573 * @group ms-required 574 574 */ 575 function test_previewing_with_switch_to_blog() {575 public function test_previewing_with_switch_to_blog() { 576 576 wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); 577 577 $type = 'option'; … … 595 595 * @ticket 33499 596 596 */ 597 function test_option_autoloading() {597 public function test_option_autoloading() { 598 598 global $wpdb; 599 599 wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
Note: See TracChangeset
for help on using the changeset viewer.