Created
March 17, 2013 10:36
-
-
Save sasezaki/5180996 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --TEST-- | |
| Sample TEST | |
| --FILE-- | |
| <?php | |
| $users = [ | |
| '太郎' => 'male', | |
| '花子' => 'female', | |
| '一郎' => 'male', | |
| ]; | |
| $users = new CallbackFilterIterator(new ArrayIterator($users), function($c, $k, $i){ | |
| return $c === 'male'; | |
| }); | |
| $expected = array ( | |
| '太郎' => 'male', | |
| '一郎' => 'male', | |
| ); | |
| var_export(iterator_to_array($users) === $expected); | |
| --EXPECT-- | |
| true |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can run test by phpunit or pyrus without any hustle.