You are here

public function CollectionTest::testPartition 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::testPartition()

File

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