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

Update readme with todo items, rename truncate to safeTruncate, and clean to collapseWhitespace

This commit is contained in:
Daniel St. Jules
2013-07-24 00:42:53 -04:00
parent e8664d3bde
commit 26ee99743c
3 changed files with 67 additions and 21 deletions

View File

@@ -263,15 +263,15 @@ class StringyTestCase extends PHPUnit_Framework_TestCase
}
/**
* @dataProvider stringsForClean
* @dataProvider stringsForCollapseWhitespace
*/
public function testClean($expected, $string)
public function testCollapseWhitespace($expected, $string)
{
$result = S::clean($string);
$result = S::collapseWhitespace($string);
$this->assertEquals($expected, $result);
}
public function stringsForClean()
public function stringsForCollapseWhitespace()
{
$testData = array(
array('foo bar', ' foo bar '),
@@ -624,16 +624,16 @@ class StringyTestCase extends PHPUnit_Framework_TestCase
}
/**
* @dataProvider stringsForTruncate
* @dataProvider stringsForSafeTruncate
*/
public function testTruncate($expected, $string, $length, $substring = '',
public function testSafeTruncate($expected, $string, $length, $substring = '',
$encoding = null)
{
$result = S::truncate($string, $length, $substring, $encoding);
$result = S::safeTruncate($string, $length, $substring, $encoding);
$this->assertEquals($expected, $result);
}
public function stringsForTruncate()
public function stringsForSafeTruncate()
{
$testData = array(
array('Test foo bar', 'Test foo bar', 12),