test wc_sanitize_tooltip

This commit is contained in:
Nicola Mustone 2015-04-09 17:24:58 +02:00
parent bf1407a60d
commit 58f86eddf9
1 changed files with 12 additions and 1 deletions

View File

@ -276,7 +276,18 @@ class Functions extends \WC_Unit_Test_Case {
*/
public function test_wc_clean() {
$this->assertInternalType( 'string', wc_clean( 'cleaned' ) );
$this->assertEquals( 'cleaned', wc_clean( '<script>alert();</script>cleaned' ) );
}
/**
* Test wc_sanitize_tooltip() - note this is a basic type test as WP core already
* has coverage for wp_kses()
*
* @since 2.4
*/
public function test_wc_sanitize_tooltip() {
$this->assertEquals( 'alert();cleaned', wc_sanitize_tooltip( '<script>alert();</script>cleaned' ) );
}
/**