You are here

public function CollectionTest::testPartition in Plug 7

File

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

Class

CollectionTest

Namespace

Doctrine\Tests\Common\Collections

Code

public function testPartition() {
  $this->collection[] = true;
  $this->collection[] = false;
  $partition = $this->collection
    ->partition(function ($k, $e) {
    return $e == true;
  });
  $this
    ->assertEquals($partition[0][0], true);
  $this
    ->assertEquals($partition[1][0], false);
}