You appear to be a bot. Output may be restricted
Description
Test WP_Customize_Selective_Refresh::add_dynamic_partials().
Usage
Test_WP_Customize_Selective_Refresh::test_add_dynamic_partials();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/customize/selective-refresh.php
Lines:
1 to 19 of 19
public function test_add_dynamic_partials() { $partial_ids = array( 'recognized', 'recognized-class', 'unrecognized', 'already-added' ); $partials = $this->selective_refresh->add_dynamic_partials( $partial_ids ); $this->assertEmpty( $partials ); $this->selective_refresh->add_partial( 'already-added' ); add_filter( 'customize_dynamic_partial_args', array( $this, 'filter_customize_dynamic_partial_args' ), 10, 2 ); add_filter( 'customize_dynamic_partial_class', array( $this, 'filter_customize_dynamic_partial_class' ), 10, 3 ); $partials = $this->selective_refresh->add_dynamic_partials( $partial_ids ); $this->assertSameSets( array( 'recognized', 'recognized-class' ), wp_list_pluck( $partials, 'id' ) ); $this->assertInstanceOf( 'Tested_Custom_Partial', $this->selective_refresh->get_partial( 'recognized-class' ) ); $this->assertNotInstanceOf( 'Tested_Custom_Partial', $this->selective_refresh->get_partial( 'recognized' ) ); $this->assertSame( '.recognized', $this->selective_refresh->get_partial( 'recognized' )->selector ); }