public function CollectionTest::testPartition

File

drupal/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Collections/CollectionTest.php, line 142

Class

CollectionTest

Namespace

Doctrine\Tests\Common\Collections

Code

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