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:
@@ -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()
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user