public static function assertObjectHasAttribute($attributeName, $object, $message = '')
{
if (!is_string($attributeName)) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string');
}
if (!preg_match('/[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*/', $attributeName)) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'valid attribute name');
}
if (!is_object($object)) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'object');
}
$constraint = new PHPUnit_Framework_Constraint_ObjectHasAttribute($attributeName);
static::assertThat($object, $constraint, $message);
}