Fix bug in style changes for the Use cases on the live site.
[yaffs-website] / vendor / phpunit / phpunit / src / Framework / Constraint / ObjectHasAttribute.php
1 <?php
2 /*
3  * This file is part of PHPUnit.
4  *
5  * (c) Sebastian Bergmann <sebastian@phpunit.de>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 /**
12  * Constraint that asserts that the object it is evaluated for has a given
13  * attribute.
14  *
15  * The attribute name is passed in the constructor.
16  *
17  * @since Class available since Release 3.0.0
18  */
19 class PHPUnit_Framework_Constraint_ObjectHasAttribute extends PHPUnit_Framework_Constraint_ClassHasAttribute
20 {
21     /**
22      * Evaluates the constraint for parameter $other. Returns true if the
23      * constraint is met, false otherwise.
24      *
25      * @param mixed $other Value or object to evaluate.
26      *
27      * @return bool
28      */
29     protected function matches($other)
30     {
31         $object = new ReflectionObject($other);
32
33         return $object->hasProperty($this->attributeName);
34     }
35 }