Asserts that an object has a specified attribute.
@since Method available since Release 3.0.0
string $attributeName:
object $object:
string $message:
public static function assertObjectHasAttribute($attributeName, $object, $message = '') {
if (!is_string($attributeName)) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string');
}
if (!is_object($object)) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'object');
}
$constraint = new PHPUnit_Framework_Constraint_ObjectHasAttribute($attributeName);
self::assertThat($object, $constraint, $message);
}