1
0
mirror of https://github.com/danielstjules/Stringy.git synced 2025-08-22 04:43:39 +02:00

Add shuffle()

This commit is contained in:
Daniel St. Jules
2013-07-23 01:47:07 -04:00
parent c5816ad928
commit 49dd8bdbc2
3 changed files with 53 additions and 4 deletions

View File

@@ -632,6 +632,25 @@ class StringyTestCase extends PHPUnit_Framework_TestCase {
return $testData;
}
/**
* @dataProvider stringsForShuffle
*/
public function testShuffle($string, $encoding = null) {
// We'll just make sure that the chars are present before/after shuffle
$result = S::shuffle($string, $encoding);
$this->assertEquals(count_chars($string), count_chars($result));
}
public function stringsForShuffle() {
$testData = array(
array('foo bar'),
array('∂∆ ˚åß', 'UTF-8'),
array('å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', 'UTF-8')
);
return $testData;
}
}
?>