You are here

public function CollectionTest::testExists in Plug 7

File

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