You are here

public function PHPUnit_Framework_MockObject_Matcher_MethodName::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/MethodName.php \PHPUnit_Framework_MockObject_Matcher_MethodName::__construct()

Parameters

PHPUnit_Framework_Constraint|string:

Throws

PHPUnit_Framework_Constraint

File

vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/MethodName.php, line 31

Class

PHPUnit_Framework_MockObject_Matcher_MethodName
Invocation matcher which looks for a specific method name in the invocations.

Code

public function __construct($constraint) {
  if (!$constraint instanceof PHPUnit_Framework_Constraint) {
    if (!is_string($constraint)) {
      throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string');
    }
    $constraint = new PHPUnit_Framework_Constraint_IsEqual($constraint, 0, 10, false, true);
  }
  $this->constraint = $constraint;
}