You are here

public function PHPUnit_Framework_Constraint_IsEqual::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/Framework/Constraint/IsEqual.php \PHPUnit_Framework_Constraint_IsEqual::__construct()

Parameters

mixed $value:

float $delta:

int $maxDepth:

bool $canonicalize:

bool $ignoreCase:

Throws

PHPUnit_Framework_Exception

Overrides PHPUnit_Framework_Constraint::__construct

File

vendor/phpunit/phpunit/src/Framework/Constraint/IsEqual.php, line 62

Class

PHPUnit_Framework_Constraint_IsEqual
Constraint that checks if one value is equal to another.

Code

public function __construct($value, $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false) {
  parent::__construct();
  if (!is_numeric($delta)) {
    throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'numeric');
  }
  if (!is_int($maxDepth)) {
    throw PHPUnit_Util_InvalidArgumentHelper::factory(3, 'integer');
  }
  if (!is_bool($canonicalize)) {
    throw PHPUnit_Util_InvalidArgumentHelper::factory(4, 'boolean');
  }
  if (!is_bool($ignoreCase)) {
    throw PHPUnit_Util_InvalidArgumentHelper::factory(5, 'boolean');
  }
  $this->value = $value;
  $this->delta = $delta;
  $this->maxDepth = $maxDepth;
  $this->canonicalize = $canonicalize;
  $this->ignoreCase = $ignoreCase;
}