From 9877d492079fe70fe1cc71e79a5af071790cf678 Mon Sep 17 00:00:00 2001 From: Nicola Mustone Date: Tue, 3 Mar 2015 12:37:57 +0100 Subject: [PATCH] test_wc_trim_string --- tests/unit-tests/formatting-functions.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/unit-tests/formatting-functions.php b/tests/unit-tests/formatting-functions.php index b5c57b1bcc1..7b0341bd818 100644 --- a/tests/unit-tests/formatting-functions.php +++ b/tests/unit-tests/formatting-functions.php @@ -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' ) ); } + /** + * 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, '.' ) ); + } + }