diff --git a/tests/phpunit/tests/kses.php b/tests/phpunit/tests/kses.php
index 916e1adf73..6d079df8f5 100644
a
|
b
|
EOF; |
755 | 755 | |
756 | 756 | $this->assertEquals( "<{$element}>", wp_kses_attr( $element, $attribute, array( 'foo' => false ), array() ) ); |
757 | 757 | } |
| 758 | |
| 759 | function test_wp_kses_array() { |
| 760 | global $allowedposttags; |
| 761 | |
| 762 | $attributes = array( |
| 763 | 'class' => 'classname', |
| 764 | 'id' => 'id', |
| 765 | 'style' => 'color: red;', |
| 766 | 'title' => 'title', |
| 767 | 'href' => 'http://example.com', |
| 768 | 'rel' => 'related', |
| 769 | 'rev' => 'revision', |
| 770 | 'name' => 'name', |
| 771 | 'target' => '_blank', |
| 772 | ); |
| 773 | |
| 774 | $input = []; |
| 775 | $output_expected = []; |
| 776 | $output_actual = []; |
| 777 | |
| 778 | foreach ( $attributes as $name => $value ) { |
| 779 | $input[] = "<a $name='$value'>I link this</a>"; |
| 780 | $output_expected[] = "<a $name='" . trim( $value, ';' ) . "'>I link this</a>"; |
| 781 | } |
| 782 | |
| 783 | $output_actual = wp_kses( $input, $allowedposttags ); |
| 784 | $this->assertEquals( $output_expected, $output_actual ); |
| 785 | } |
758 | 786 | } |