- Timestamp:
- 11/04/2021 03:22:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/custom-css-setting.php
r51568 r52010 28 28 * @see WP_UnitTestCase::setup() 29 29 */ 30 function set_up() {30 public function set_up() { 31 31 parent::set_up(); 32 32 require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; … … 55 55 * Tear down the test case. 56 56 */ 57 function tear_down() {57 public function tear_down() { 58 58 $this->setting = null; 59 59 parent::tear_down(); … … 63 63 * Delete the $wp_customize global when cleaning up scope. 64 64 */ 65 function clean_up_global_scope() {65 public function clean_up_global_scope() { 66 66 global $wp_customize; 67 67 $wp_customize = null; … … 78 78 * @covers WP_Customize_Custom_CSS_Setting::__construct 79 79 */ 80 function test_construct() {80 public function test_construct() { 81 81 $this->assertTrue( post_type_exists( 'custom_css' ) ); 82 82 $this->assertSame( 'custom_css', $this->setting->type ); … … 111 111 * @covers WP_Customize_Custom_CSS_Setting::update 112 112 */ 113 function test_crud() {113 public function test_crud() { 114 114 115 115 $this->setting->default = '/* Hello World */'; … … 212 212 * @ticket 39032 213 213 */ 214 function test_custom_css_revision_saved() {214 public function test_custom_css_revision_saved() { 215 215 $inserted_css = 'body { background: black; }'; 216 216 $updated_css = 'body { background: red; }'; … … 246 246 * @ticket 39259 247 247 */ 248 function test_get_custom_css_post_queries_after_failed_lookup() {248 public function test_get_custom_css_post_queries_after_failed_lookup() { 249 249 set_theme_mod( 'custom_css_post_id', -1 ); 250 250 $queries_before = get_num_queries(); … … 258 258 * @ticket 39259 259 259 */ 260 function test_update_custom_css_updates_theme_mod() {260 public function test_update_custom_css_updates_theme_mod() { 261 261 set_theme_mod( 'custom_css_post_id', -1 ); 262 262 $post = wp_update_custom_css_post( 'body { background: blue; }' ); … … 269 269 * @covers WP_Customize_Custom_CSS_Setting::value 270 270 */ 271 function test_value_filter() {271 public function test_value_filter() { 272 272 add_filter( 'customize_value_custom_css', array( $this, 'filter_value' ), 10, 2 ); 273 273 $this->setting->default = '/*default*/'; … … 298 298 * @return string 299 299 */ 300 function filter_value( $value, $setting ) {300 public function filter_value( $value, $setting ) { 301 301 $this->assertInstanceOf( 'WP_Customize_Custom_CSS_Setting', $setting ); 302 302 $value .= '/*filtered*/'; … … 309 309 * @covers WP_Customize_Custom_CSS_Setting::update 310 310 */ 311 function test_update_filter() {311 public function test_update_filter() { 312 312 $original_css = 'body { color:red; }'; 313 313 $post_id = $this->factory()->post->create( … … 344 344 * @return array Data. 345 345 */ 346 function filter_update_custom_css_data( $data, $args ) {346 public function filter_update_custom_css_data( $data, $args ) { 347 347 $this->assertIsArray( $data ); 348 348 $this->assertSameSets( array( 'css', 'preprocessed' ), array_keys( $data ) ); … … 367 367 * @covers WP_Customize_Custom_CSS_Setting::validate 368 368 */ 369 function test_validate() {369 public function test_validate() { 370 370 371 371 // Empty CSS throws no errors.
Note: See TracChangeset
for help on using the changeset viewer.