From 773477cdd88c509e75306555b4413055906c15d5 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Tue, 6 Jan 2015 00:39:31 +0100 Subject: [PATCH] Add missing tests in StringyTest For consistency with StaticStringyTest. --- tests/StringyTest.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/StringyTest.php b/tests/StringyTest.php index cd25034..0a60a7b 100644 --- a/tests/StringyTest.php +++ b/tests/StringyTest.php @@ -545,6 +545,19 @@ class StringyTestCase extends CommonTest $this->assertEquals($str, $stringy); } + /** + * @dataProvider safeTruncateProvider() + */ + public function testSafeTruncate($expected, $str, $length, $substring = '', + $encoding = null) + { + $stringy = S::create($str, $encoding); + $result = $stringy->safeTruncate($length, $substring); + $this->assertStringy($result); + $this->assertEquals($expected, $result); + $this->assertEquals($str, $stringy); + } + /** * @dataProvider reverseProvider() */ @@ -605,6 +618,19 @@ class StringyTestCase extends CommonTest $this->assertEquals($str, $stringy); } + /** + * @dataProvider longestCommonSuffixProvider() + */ + public function testLongestCommonSuffix($expected, $str, $otherStr, + $encoding = null) + { + $stringy = S::create($str, $encoding); + $result = $stringy->longestCommonSuffix($otherStr); + $this->assertStringy($result); + $this->assertEquals($expected, $result); + $this->assertEquals($str, $stringy); + } + /** * @dataProvider longestCommonSubstringProvider() */