You appear to be a bot. Output may be restricted
Description
Test WP_Customize_Partial::__construct().
Usage
Test_WP_Customize_Partial::test_construct_non_default_args();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/customize/partial.php
Lines:
1 to 42 of 42
function test_construct_non_default_args() { $post_id = self::factory()->post->create( array( 'post_title' => 'Hello World', 'post_content' => 'Lorem Ipsum', ) ); $partial_id = sprintf( 'post_content[%d]', $post_id ); $args = array( 'type' => 'post', 'selector' => "article.post-$post_id .entry-content", 'settings' => array( 'user[1]', "post[$post_id]" ), 'primary_setting' => "post[$post_id]", 'render_callback' => array( $this, 'render_post_content_partial' ), 'container_inclusive' => false, 'fallback_refresh' => false, ); $partial = new WP_Customize_Partial( $this->selective_refresh, $partial_id, $args ); $this->assertEquals( $partial_id, $partial->id ); $this->assertEquals( $this->selective_refresh, $partial->component ); $this->assertEquals( $args['type'], $partial->type ); $this->assertEquals( $args['selector'], $partial->selector ); $this->assertEqualSets( $args['settings'], $partial->settings ); $this->assertEquals( $args['primary_setting'], $partial->primary_setting ); $this->assertEquals( $args['render_callback'], $partial->render_callback ); $this->assertEquals( false, $partial->container_inclusive ); $this->assertEquals( false, $partial->fallback_refresh ); $this->assertContains( 'Lorem Ipsum', $partial->render() ); $partial = new WP_Customize_Partial( $this->selective_refresh, $partial_id, array( 'settings' => 'blogdescription', ) ); $this->assertEquals( array( 'blogdescription' ), $partial->settings ); $this->assertEquals( 'blogdescription', $partial->primary_setting ); }