Example #1
0
 public function testEach()
 {
     $collection = new Collection(array(1, 2, 3, 4));
     $test = array();
     $collection->each(function ($value) use(&$test) {
         $test[] = $value * 2;
     });
     $this->assertEquals(array(2, 4, 6, 8), $test);
 }