lithium\tests\cases\data\CollectionTest::testMap PHP Method

testMap() public method

Tests Collection::map.
public testMap ( )
    public function testMap()
    {
        $collection = new MockCollection(array('data' => array('Lorem Ipsum', 'value', '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'));
    }