public function CollectionTest::testFilter in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/CollectionTest.php \Doctrine\Tests\Common\Collections\CollectionTest::testFilter()
File
- vendor/
doctrine/ collections/ tests/ Doctrine/ Tests/ Common/ Collections/ CollectionTest.php, line 59
Class
Namespace
Doctrine\Tests\Common\CollectionsCode
public function testFilter() {
$this->collection
->add(1);
$this->collection
->add("foo");
$this->collection
->add(3);
$res = $this->collection
->filter(function ($e) {
return is_numeric($e);
});
$this
->assertEquals(array(
0 => 1,
2 => 3,
), $res
->toArray());
}