Extends
lithium\test\Unit
Tests `Collection::each`.
Source
public function testEach() {
$collection = new DocumentSet();
$collection->set(array(
'title' => 'Lorem Ipsum',
'key' => 'value',
'foo' => 'bar'
));
$collection->each(function($value) {
return $value . ' test';
});
$expected = array(
'Lorem Ipsum test',
'value test',
'bar test'
);
$this->assertEqual($collection->to('array'), $expected);
}