- 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.php
r51568 r52010 30 30 * Set up the test fixture. 31 31 */ 32 function set_up() {32 public function set_up() { 33 33 parent::set_up(); 34 34 require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; … … 45 45 * @see WP_Customize_Selective_Refresh::__construct() 46 46 */ 47 function test_construct() {47 public function test_construct() { 48 48 $this->assertSame( $this->selective_refresh, $this->wp_customize->selective_refresh ); 49 49 } … … 54 54 * @see WP_Customize_Selective_Refresh::register_scripts() 55 55 */ 56 function test_register_scripts() {56 public function test_register_scripts() { 57 57 $scripts = new WP_Scripts(); 58 58 $handles = array( … … 71 71 * @see WP_Customize_Selective_Refresh::partials() 72 72 */ 73 function test_partials() {73 public function test_partials() { 74 74 $this->assertIsArray( $this->selective_refresh->partials() ); 75 75 } … … 82 82 * @see WP_Customize_Selective_Refresh::remove_partial() 83 83 */ 84 function test_crud_partial() {84 public function test_crud_partial() { 85 85 $partial = $this->selective_refresh->add_partial( 'foo' ); 86 86 $this->assertSame( $this->selective_refresh, $partial->component ); … … 111 111 * @see WP_Customize_Selective_Refresh::init_preview() 112 112 */ 113 function test_init_preview() {113 public function test_init_preview() { 114 114 $this->selective_refresh->init_preview(); 115 115 $this->assertSame( 10, has_action( 'template_redirect', array( $this->selective_refresh, 'handle_render_partials_request' ) ) ); … … 122 122 * @see WP_Customize_Selective_Refresh::enqueue_preview_scripts() 123 123 */ 124 function test_enqueue_preview_scripts() {124 public function test_enqueue_preview_scripts() { 125 125 $scripts = wp_scripts(); 126 126 $this->assertNotContains( 'customize-selective-refresh', $scripts->queue ); … … 135 135 * @see WP_Customize_Selective_Refresh::export_preview_data() 136 136 */ 137 function test_export_preview_data() {137 public function test_export_preview_data() { 138 138 $user_id = self::factory()->user->create( array( 'role' => 'administrator' ) ); 139 139 wp_set_current_user( $user_id ); … … 179 179 * @see WP_Customize_Selective_Refresh::add_dynamic_partials() 180 180 */ 181 function test_add_dynamic_partials() {181 public function test_add_dynamic_partials() { 182 182 $partial_ids = array( 'recognized', 'recognized-class', 'unrecognized', 'already-added' ); 183 183 … … 207 207 * @return false|array Dynamic partial args. 208 208 */ 209 function filter_customize_dynamic_partial_args( $partial_args, $partial_id ) {209 public function filter_customize_dynamic_partial_args( $partial_args, $partial_id ) { 210 210 $this->assertTrue( false === $partial_args || is_array( $partial_args ) ); 211 211 $this->assertIsString( $partial_id ); … … 230 230 * @return string 231 231 */ 232 function filter_customize_dynamic_partial_class( $partial_class, $partial_id, $partial_args ) {232 public function filter_customize_dynamic_partial_class( $partial_class, $partial_id, $partial_args ) { 233 233 $this->assertIsArray( $partial_args ); 234 234 $this->assertIsString( $partial_id ); … … 247 247 * @see WP_Customize_Selective_Refresh::is_render_partials_request() 248 248 */ 249 function test_is_render_partials_request() {249 public function test_is_render_partials_request() { 250 250 $this->assertFalse( $this->selective_refresh->is_render_partials_request() ); 251 251 $_POST[ WP_Customize_Selective_Refresh::RENDER_QUERY_VAR ] = '1'; … … 256 256 * Tear down. 257 257 */ 258 function tear_down() {258 public function tear_down() { 259 259 $this->wp_customize = null; 260 260 unset( $GLOBALS['wp_customize'] );
Note: See TracChangeset
for help on using the changeset viewer.