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