contains() public method

Determine if a key exists in the collection.
public contains ( mixed $key ) : boolean
$key mixed
return boolean
コード例 #1
0
ファイル: CollectionTest.php プロジェクト: Joal01/fof
 /**
  * @group           DataModel
  * @group           CollectionContains
  * @covers          FOF30\Model\DataModel\Collection::contains
  * @dataProvider    CollectionDataprovider::getTestContains
  */
 public function testContains($test, $check)
 {
     $msg = 'Collection::contains %s - Case: ' . $check['case'];
     $items = $this->buildCollection();
     $collection = new Collection($items);
     $result = $collection->contains($test['key']);
     $this->assertEquals($check['result'], $result, sprintf($msg, 'Failed to return the correct value'));
 }