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:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user