You are here

public function PHPUnit_Framework_Constraint_Callback::__construct in Zircon Profile 8

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

Parameters

callable $callback:

Throws

PHPUnit_Framework_Exception

Overrides PHPUnit_Framework_Constraint::__construct

File

vendor/phpunit/phpunit/src/Framework/Constraint/Callback.php, line 22

Class

PHPUnit_Framework_Constraint_Callback
Constraint that evaluates against a specified closure.

Code

public function __construct($callback) {
  if (!is_callable($callback)) {
    throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'callable');
  }
  parent::__construct();
  $this->callback = $callback;
}