You are here

public function PHPUnit_Framework_Constraint_TraversableContains::__construct in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContains.php \PHPUnit_Framework_Constraint_TraversableContains::__construct()

Parameters

mixed $value:

bool $checkForObjectIdentity:

bool $checkForNonObjectIdentity:

Throws

PHPUnit_Framework_Exception

Overrides PHPUnit_Framework_Constraint::__construct

File

vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContains.php, line 40

Class

PHPUnit_Framework_Constraint_TraversableContains
Constraint that asserts that the Traversable it is applied to contains a given value.

Code

public function __construct($value, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false) {
  parent::__construct();
  if (!is_bool($checkForObjectIdentity)) {
    throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'boolean');
  }
  if (!is_bool($checkForNonObjectIdentity)) {
    throw PHPUnit_Util_InvalidArgumentHelper::factory(3, 'boolean');
  }
  $this->checkForObjectIdentity = $checkForObjectIdentity;
  $this->checkForNonObjectIdentity = $checkForNonObjectIdentity;
  $this->value = $value;
}