Make WordPress Core

Ticket #50860: 50860.diff

File 50860.diff, 1.3 KB (added by ediamin, 5 years ago)
  • tests/phpunit/tests/kses.php

    diff --git a/tests/phpunit/tests/kses.php b/tests/phpunit/tests/kses.php
    index 2c5a6c6706..0c45a853a2 100644
    a b class Tests_Kses extends WP_UnitTestCase { 
    1616                $attributes = array(
    1717                        'class' => 'classname',
    1818                        'id'    => 'id',
    19                         'style' => 'color: red;',
    20                         'style' => 'color: red',
    21                         'style' => 'color: red; text-align:center',
    22                         'style' => 'color: red; text-align:center;',
    2319                        'title' => 'title',
    2420                );
    2521
    class Tests_Kses extends WP_UnitTestCase { 
    2824                        $expect_string = "<address $name='" . str_replace( '; ', ';', trim( $value, ';' ) ) . "'>1 WordPress Avenue, The Internet.</address>";
    2925                        $this->assertEquals( $expect_string, wp_kses( $string, $allowedposttags ) );
    3026                }
     27
     28                $style_attributes = array(
     29                        'color: red;',
     30                        'color: red',
     31                        'color: red; text-align:center',
     32                        'color: red; text-align:center;',
     33                );
     34
     35                foreach ( $style_attributes as $value ) {
     36                        $string        = "<address style='$value'>1 WordPress Avenue, The Internet.</address>";
     37                        $expect_string = "<address style='" . str_replace( '; ', ';', trim( $value, ';' ) ) . "'>1 WordPress Avenue, The Internet.</address>";
     38                        $this->assertEquals( $expect_string, wp_kses( $string, $allowedposttags ) );
     39                }
    3140        }
    3241
    3342        /**