3 * This file is part of PHPUnit.
5 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
12 * Constraint that asserts that the object it is evaluated for has a given
15 * The attribute name is passed in the constructor.
17 * @since Class available since Release 3.0.0
19 class PHPUnit_Framework_Constraint_ObjectHasAttribute extends PHPUnit_Framework_Constraint_ClassHasAttribute
22 * Evaluates the constraint for parameter $other. Returns true if the
23 * constraint is met, false otherwise.
25 * @param mixed $other Value or object to evaluate.
29 protected function matches($other)
31 $object = new ReflectionObject($other);
33 return $object->hasProperty($this->attributeName);