test_wc_trim_string

This commit is contained in:
Nicola Mustone 2015-03-03 12:37:57 +01:00
parent f1f8759c41
commit 9877d49207
1 changed files with 12 additions and 0 deletions

View File

@ -542,4 +542,16 @@ class WC_Tests_Formatting_Functions extends WC_Unit_Test_Case {
$this->assertEquals( '1-610-385-0000', wc_format_phone_number( '1.610.385.0000' ) ); $this->assertEquals( '1-610-385-0000', wc_format_phone_number( '1.610.385.0000' ) );
} }
/**
* Test wc_trim_string()
*
* @since 2.2
*/
public function test_wc_trim_string() {
$this->assertEquals( 'string', wc_trim_string( 'string' ) );
$this->assertEquals( 's...', wc_trim_string( 'string', 4 ) );
$this->assertEquals( 'st.', wc_trim_string( 'string', 3, '.' ) );
}
} }