1
0
mirror of https://github.com/danielstjules/Stringy.git synced 2025-08-28 15:29:58 +02:00

Add reverse()

This commit is contained in:
Daniel St. Jules
2013-07-23 01:11:13 -04:00
parent 1e2f49128b
commit 4bb791e318
3 changed files with 52 additions and 7 deletions

View File

@@ -612,6 +612,25 @@ class StringyTestCase extends PHPUnit_Framework_TestCase {
return $testData;
}
/**
* @dataProvider stringsForReverse
*/
public function testReverse($expected, $string, $encoding = null) {
$result = S::reverse($string, $encoding);
$this->assertEquals($expected, $result);
}
public function stringsForReverse() {
$testData = array(
array('', ''),
array('raboof', 'foobar'),
array('řàb ôòf', 'fòô bàř', 'UTF-8'),
array('∂∆ ˚åß', 'ßå˚ ∆∂', 'UTF-8')
);
return $testData;
}
}
?>