You are here

public function CollectionTest::testMap in Plug 7

File

lib/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CollectionTest.php, line 51

Class

CollectionTest

Namespace

Doctrine\Tests\Common\Collections

Code

public function testMap() {
  $this->collection
    ->add(1);
  $this->collection
    ->add(2);
  $res = $this->collection
    ->map(function ($e) {
    return $e * 2;
  });
  $this
    ->assertEquals(array(
    2,
    4,
  ), $res
    ->toArray());
}