Skip to content

Commit

Permalink
feat(kses): added unit test for kses_allowed_html
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarshall511 committed Jul 20, 2023
1 parent 7770953 commit 145103b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion includes/safe-svg-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static function getTags() {
*
* @return array Array of allowed HTML tags and their allowed attributes.
*/
public function kses_allowed_html() {
public static function kses_allowed_html() {
return array(
'svg' => array(
'version' => true,
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/test-safe-svg-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,14 @@ public function test_get_tags() {
$this->assertContains( 'customTag', $svg_tags );
$this->assertSame( $svg_tags, $filtered_svg_tags );
}

/**
* Test the kses_allowed_html function.
*
* @throws PHPUnit\Framework\AssertionFailedError If the function does not return an array.
*/
public function test_kses_allowed_html() {
$allowed_html = SafeSvg\SafeSvgTags\safe_svg_tags::kses_allowed_html();
$this->assertIsArray( $allowed_html );
}
}

0 comments on commit 145103b

Please sign in to comment.