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