You appear to be a bot. Output may be restricted
Description
Test crud methods on WP_Customize_Custom_CSS_Setting.
Usage
Test_WP_Customize_Custom_CSS_Setting::test_value_filter();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/customize/custom-css-setting.php
Lines:
1 to 22 of 22
function test_value_filter() { add_filter( 'customize_value_custom_css', array( $this, 'filter_value' ), 10, 2 ); $this->setting->default = '/*default*/'; $this->assertEquals( '/*default*//*filtered*/', $this->setting->value() ); $this->factory()->post->create( array( 'post_title' => $this->setting->stylesheet, 'post_name' => $this->setting->stylesheet, 'post_content' => '/*custom*/', 'post_status' => 'publish', 'post_type' => 'custom_css', ) ); remove_theme_mod( 'custom_css_post_id' ); $this->assertEquals( '/*custom*//*filtered*/', $this->setting->value() ); $this->wp_customize->set_post_value( $this->setting->id, '/*overridden*/' ); $this->setting->preview(); $this->assertEquals( '/*overridden*/', $this->setting->value(), 'Expected value to not be filtered since post value is present.' ); }