You are here

public function CollectionTest::testMap in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CollectionTest.php \Doctrine\Tests\Common\Collections\CollectionTest::testMap()

File

vendor/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());
}