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

Add clean, standardize, and table of contents to the readme

This commit is contained in:
Daniel St. Jules
2013-07-14 00:18:55 -04:00
parent b632268623
commit fe9828a948
3 changed files with 147 additions and 23 deletions

View File

@@ -247,6 +247,42 @@ class StringyTestCase extends PHPUnit_Framework_TestCase {
return $testData;
}
/**
* @dataProvider stringsForClean
*/
public function testClean($string, $expected) {
$result = S::clean($string);
$this->assertEquals($expected, $result);
}
public function stringsForClean() {
$testData = array(
array(' foo bar ', 'foo bar'),
array('test string', 'test string'),
array(' Ο συγγραφέας ', 'Ο συγγραφέας')
);
return $testData;
}
/**
* @dataProvider stringsForStandardize
*/
public function testStandardize($string, $expected) {
$result = S::standardize($string);
$this->assertEquals($expected, $result);
}
public function stringsForStandardize() {
$testData = array(
array('fòô bàř', 'foo bar'),
array(' ŤÉŚŢ ', ' TEST '),
array('φ = ź = 3', 'φ = z = 3')
);
return $testData;
}
}
?>