Example #1
0
 function testIntegratedIndex()
 {
     $strings = new qinq\Collection(['foo', 'bar', 'bink']);
     $matches_key = ['1-foo', '2-bar', '3-bink'];
     $matches_value = ['foo', 'bar', 'bink'];
     foreach ($strings->index(function ($value, $oldKey) {
         return $oldKey + 1 . '-' . $value;
     }) as $index => $value) {
         $match_key = array_shift($matches_key);
         $match_value = array_shift($matches_value);
         $this->assertEquals($match_key, $index);
         $this->assertEquals($match_value, $value);
     }
 }