From 58f9000f3e0303266733dcd92ac36712d6185481 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 6 Aug 2020 13:26:06 +0000 Subject: [PATCH] Tests: Correct duplicate array keys in `Tests_Kses::test_wp_filter_post_kses_address()`. Previously, only the last `style` value was actually tested. Props ediamin. Fixes #50860. git-svn-id: https://develop.svn.wordpress.org/trunk@48744 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/kses.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/phpunit/tests/kses.php b/tests/phpunit/tests/kses.php index 2c5a6c6706..37753260e9 100644 --- a/tests/phpunit/tests/kses.php +++ b/tests/phpunit/tests/kses.php @@ -16,17 +16,21 @@ class Tests_Kses extends WP_UnitTestCase { $attributes = array( 'class' => 'classname', 'id' => 'id', - 'style' => 'color: red;', - 'style' => 'color: red', - 'style' => 'color: red; text-align:center', - 'style' => 'color: red; text-align:center;', + 'style' => array( + 'color: red;', + 'color: red', + 'color: red; text-align:center', + 'color: red; text-align:center;', + ), 'title' => 'title', ); - foreach ( $attributes as $name => $value ) { - $string = "
1 WordPress Avenue, The Internet.
"; - $expect_string = "
1 WordPress Avenue, The Internet.
"; - $this->assertEquals( $expect_string, wp_kses( $string, $allowedposttags ) ); + foreach ( $attributes as $name => $values ) { + foreach ( (array) $values as $value ) { + $string = "
1 WordPress Avenue, The Internet.
"; + $expect_string = "
1 WordPress Avenue, The Internet.
"; + $this->assertEquals( $expect_string, wp_kses( $string, $allowedposttags ) ); + } } }