- Timestamp:
- 11/04/2021 03:22:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/selective-refresh-ajax.php
r51568 r52010 35 35 * Set up the test fixture. 36 36 */ 37 function set_up() {37 public function set_up() { 38 38 parent::set_up(); 39 39 … … 53 53 * Do Customizer boot actions. 54 54 */ 55 function do_customize_boot_actions() {55 private function do_customize_boot_actions() { 56 56 $_SERVER['REQUEST_METHOD'] = 'POST'; 57 57 do_action( 'setup_theme' ); … … 68 68 * @see WP_Customize_Selective_Refresh::handle_render_partials_request() 69 69 */ 70 function test_handle_render_partials_request_for_unauthenticated_user() {70 public function test_handle_render_partials_request_for_unauthenticated_user() { 71 71 $_POST[ WP_Customize_Selective_Refresh::RENDER_QUERY_VAR ] = '1'; 72 72 … … 124 124 * Set the current user to be an admin, add the preview nonce, and set the query var. 125 125 */ 126 function setup_valid_render_partials_request_environment() {126 private function setup_valid_render_partials_request_environment() { 127 127 wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); 128 128 $_REQUEST['nonce'] = wp_create_nonce( 'preview-customize_' . $this->wp_customize->theme()->get_stylesheet() ); … … 136 136 * @see WP_Customize_Selective_Refresh::handle_render_partials_request() 137 137 */ 138 function test_handle_render_partials_request_for_unrecognized_partial() {138 public function test_handle_render_partials_request_for_unrecognized_partial() { 139 139 $this->setup_valid_render_partials_request_environment(); 140 140 $context_data = array(); … … 173 173 * @see WP_Customize_Selective_Refresh::handle_render_partials_request() 174 174 */ 175 function test_handle_render_partials_request_for_non_rendering_partial() {175 public function test_handle_render_partials_request_for_non_rendering_partial() { 176 176 $this->setup_valid_render_partials_request_environment(); 177 177 wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); … … 212 212 * @see WP_Customize_Selective_Refresh::handle_render_partials_request() 213 213 */ 214 function test_handle_rendering_disallowed_partial() {214 public function test_handle_rendering_disallowed_partial() { 215 215 $this->setup_valid_render_partials_request_environment(); 216 216 wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); … … 248 248 * @see WP_Customize_Selective_Refresh::handle_render_partials_request() 249 249 */ 250 function test_handle_rendering_partial_with_missing_settings() {250 public function test_handle_rendering_partial_with_missing_settings() { 251 251 $this->setup_valid_render_partials_request_environment(); 252 252 wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); … … 280 280 * @return string 281 281 */ 282 function render_callback_blogname( $partial, $context ) {282 public function render_callback_blogname( $partial, $context ) { 283 283 $this->assertIsArray( $context ); 284 284 $this->assertInstanceOf( 'WP_Customize_Partial', $partial ); … … 293 293 * @return string 294 294 */ 295 function render_callback_blogdescription( $partial, $context ) {295 public function render_callback_blogdescription( $partial, $context ) { 296 296 $this->assertIsArray( $context ); 297 297 $this->assertInstanceOf( 'WP_Customize_Partial', $partial ); … … 305 305 * @see WP_Customize_Selective_Refresh::handle_render_partials_request() 306 306 */ 307 function test_handle_render_partials_request_with_single_valid_placement() {307 public function test_handle_render_partials_request_with_single_valid_placement() { 308 308 $this->setup_valid_render_partials_request_environment(); 309 309 … … 354 354 * @return array|false Args. 355 355 */ 356 function filter_customize_dynamic_partial_args( $partial_args, $partial_id ) {356 public function filter_customize_dynamic_partial_args( $partial_args, $partial_id ) { 357 357 if ( 'test_dynamic_blogname' === $partial_id ) { 358 358 $partial_args = array( … … 374 374 * @return array Response. 375 375 */ 376 function filter_customize_render_partials_response( $response, $component, $partial_placements ) {376 public function filter_customize_render_partials_response( $response, $component, $partial_placements ) { 377 377 $this->assertIsArray( $response ); 378 378 $this->assertInstanceOf( 'WP_Customize_Selective_Refresh', $component ); … … 396 396 * @param array $partial_placements Partial IDs. 397 397 */ 398 function handle_action_customize_render_partials_after( $component, $partial_placements ) {398 public function handle_action_customize_render_partials_after( $component, $partial_placements ) { 399 399 $this->assertInstanceOf( 'WP_Customize_Selective_Refresh', $component ); 400 400 if ( isset( $this->expected_partial_ids ) ) { … … 409 409 * @param array $partial_placements Partial IDs. 410 410 */ 411 function handle_action_customize_render_partials_before( $component, $partial_placements ) {411 public function handle_action_customize_render_partials_before( $component, $partial_placements ) { 412 412 $this->assertInstanceOf( 'WP_Customize_Selective_Refresh', $component ); 413 413 if ( isset( $this->expected_partial_ids ) ) { … … 421 421 * @see WP_Customize_Selective_Refresh::handle_render_partials_request() 422 422 */ 423 function test_handle_render_partials_request_for_dynamic_partial() {423 public function test_handle_render_partials_request_for_dynamic_partial() { 424 424 $this->setup_valid_render_partials_request_environment(); 425 425 add_filter( 'customize_dynamic_partial_args', array( $this, 'filter_customize_dynamic_partial_args' ), 10, 2 ); … … 459 459 * @see WP_Customize_Selective_Refresh::handle_render_partials_request() 460 460 */ 461 function test_handle_render_partials_request_for_multiple_partials_placements() {461 public function test_handle_render_partials_request_for_multiple_partials_placements() { 462 462 $this->setup_valid_render_partials_request_environment(); 463 463 … … 510 510 * Tear down. 511 511 */ 512 function tear_down() {512 public function tear_down() { 513 513 $this->expected_partial_ids = null; 514 514 $this->wp_customize = null;
Note: See TracChangeset
for help on using the changeset viewer.