protected function PHPUnit_Framework_Constraint_ObjectHasAttribute::matches

Evaluates the constraint for parameter $other. Returns TRUE if the constraint is met, FALSE otherwise.

Parameters

mixed $other Value or object to evaluate.:

Return value

bool

Overrides PHPUnit_Framework_Constraint_ClassHasAttribute::matches

File

drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/Constraint/ObjectHasAttribute.php, line 71

Class

PHPUnit_Framework_Constraint_ObjectHasAttribute
Constraint that asserts that the object it is evaluated for has a given attribute.

Code

protected function matches($other) {
  $object = new ReflectionObject($other);
  return $object
    ->hasProperty($this->attributeName);
}