1
0
mirror of https://github.com/danielstjules/Stringy.git synced 2025-08-12 08:14:06 +02:00

Add missing tests in StringyTest

For consistency with StaticStringyTest.
This commit is contained in:
vlakoff
2015-01-06 00:39:31 +01:00
parent f3d32c79b0
commit 773477cdd8

View File

@@ -545,6 +545,19 @@ class StringyTestCase extends CommonTest
$this->assertEquals($str, $stringy); $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() * @dataProvider reverseProvider()
*/ */
@@ -605,6 +618,19 @@ class StringyTestCase extends CommonTest
$this->assertEquals($str, $stringy); $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() * @dataProvider longestCommonSubstringProvider()
*/ */