Ejemplo n.º 1
0
 public function testTakeWhile()
 {
     $newMap = $this->map->takeWhile(function ($k, $v) {
         return 'foo' === $k || 'baz' === $v;
     });
     $this->assertEquals(array('foo' => 'bar', 'bar' => 'baz'), iterator_to_array($newMap));
     $this->assertCount(3, $this->map);
 }