WordPress.org

Make WordPress Core

Changeset 1092 in tests


Ignore:
Timestamp:
10/25/2012 12:52:15 PM (6 years ago)
Author:
ryan
Message:

Update #WP20210 tests to strip trailing semicolons from style attributes when comparing to kses filtered strings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/kses.php

    r1028 r1092  
    1818            'id' => 'id',
    1919            'style' => 'color: red;',
     20            'style' => 'color: red',
     21            'style' => 'color: red; text-align:center',
     22            'style' => 'color: red; text-align:center;',
    2023            'title' => 'title',
    2124        );
     
    2326        foreach ( $attributes as $name => $value ) {
    2427            $string = "<address $name='$value'>1 WordPress Avenue, The Internet.</address>";
    25             $this->assertEquals( $string, wp_kses( $string, $allowedposttags ) );
     28            $expect_string = "<address $name='" . str_replace( '; ', ';', trim( $value, ';' ) ) . "'>1 WordPress Avenue, The Internet.</address>";
     29            $this->assertEquals( $expect_string, wp_kses( $string, $allowedposttags ) );
    2630        }
    2731    }
     
    4751        foreach ( $attributes as $name => $value ) {
    4852            $string = "<a $name='$value'>I link this</a>";
    49             $this->assertEquals( $string, wp_kses( $string, $allowedposttags ) );
     53            $expect_string = "<a $name='" . trim( $value, ';' ) . "'>I link this</a>";
     54            $this->assertEquals( $expect_string, wp_kses( $string, $allowedposttags ) );
    5055        }
    5156    }
     
    6671        foreach ( $attributes as $name => $value ) {
    6772            $string = "<abbr $name='$value'>WP</abbr>";
    68             $this->assertEquals( $string, wp_kses( $string, $allowedposttags ) );
     73            $expect_string = "<abbr $name='" . trim( $value, ';' ) . "'>WP</abbr>";
     74            $this->assertEquals( $expect_string, wp_kses( $string, $allowedposttags ) );
    6975        }
    7076    }
Note: See TracChangeset for help on using the changeset viewer.