lithium\tests\cases\data\CollectionTest::testEach PHP Метод

testEach() публичный Метод

Tests Collection::each.
public testEach ( )
    public function testEach()
    {
        $collection = new MockCollection(array('data' => array('Lorem Ipsum', 'value', 'bar')));
        $collection->each(function ($value) {
            return $value . ' test';
        });
        $expected = array('Lorem Ipsum test', 'value test', 'bar test');
        $this->assertEqual($expected, $collection->to('array'));
    }