mirror of
https://github.com/danielstjules/Stringy.git
synced 2025-08-28 15:29:58 +02:00
Add reverse()
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user