You are here

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

File

vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CollectionTest.php, line 41

Class

CollectionTest

Namespace

Doctrine\Tests\Common\Collections

Code

public function testExists() {
  $this->collection
    ->add("one");
  $this->collection
    ->add("two");
  $exists = $this->collection
    ->exists(function ($k, $e) {
    return $e == "one";
  });
  $this
    ->assertTrue($exists);
  $exists = $this->collection
    ->exists(function ($k, $e) {
    return $e == "other";
  });
  $this
    ->assertFalse($exists);
}