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); }