public function ArrayCollectionTest::testContainsKey in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/doctrine/collections/tests/Doctrine/Tests/Common/Collections/ArrayCollectionTest.php \Doctrine\Tests\Common\Collections\ArrayCollectionTest::testContainsKey()
File
- vendor/
doctrine/ collections/ tests/ Doctrine/ Tests/ Common/ Collections/ ArrayCollectionTest.php, line 208
Class
- ArrayCollectionTest
- Tests for { @covers \Doctrine\Common\Collections\ArrayCollection
Namespace
Doctrine\Tests\Common\CollectionsCode
public function testContainsKey() {
$elements = array(
1,
'A' => 'a',
2,
'null' => null,
3,
'A2' => 'a',
'B2' => 'b',
);
$collection = new ArrayCollection($elements);
$this
->assertTrue($collection
->containsKey(0), "Contains index 0");
$this
->assertTrue($collection
->containsKey('A'), "Contains key \"A\"");
$this
->assertTrue($collection
->containsKey('null'), "Contains key \"null\", with value null");
$this
->assertFalse($collection
->containsKey('non-existent'), "Doesn't contain key");
}