You appear to be a bot. Output may be restricted
Description
Test CRUD methods for partials.
Usage
Test_WP_Customize_Selective_Refresh::test_crud_partial();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/customize/selective-refresh.php
Lines:
1 to 24 of 24
public function test_crud_partial() { $partial = $this->selective_refresh->add_partial( 'foo' ); $this->assertSame( $this->selective_refresh, $partial->component ); $this->assertInstanceOf( 'WP_Customize_Partial', $partial ); $this->assertSame( $partial, $this->selective_refresh->get_partial( $partial->id ) ); $this->assertArrayHasKey( $partial->id, $this->selective_refresh->partials() ); $this->selective_refresh->remove_partial( $partial->id ); $this->assertEmpty( $this->selective_refresh->get_partial( $partial->id ) ); $this->assertArrayNotHasKey( $partial->id, $this->selective_refresh->partials() ); $partial = new WP_Customize_Partial( $this->selective_refresh, 'bar' ); $this->assertSame( $partial, $this->selective_refresh->add_partial( $partial ) ); $this->assertSame( $partial, $this->selective_refresh->get_partial( 'bar' ) ); $this->assertSameSets( array( 'bar' ), array_keys( $this->selective_refresh->partials() ) ); 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 ); $partial = $this->selective_refresh->add_partial( 'recognized-class' ); $this->assertInstanceOf( 'Tested_Custom_Partial', $partial ); $this->assertSame( '.recognized', $partial->selector ); }