Here's a unit test I wrote today that makes sure every public CFC function has a hint attribute specified:
<cffunction name="testPublicFunctionHasHint"> <cfset var md = GetMetaData(variables.instance)> <cfset var i = 0> <cfset var f = ""> <cfif IsDefined("md.functions") AND ArrayLen(md.functions)> <cfloop from="1" to="#ArrayLen(md.functions)#" index="i"> <cfif NOT StructKeyExists(md.functions[i], "access") OR LCase(md.functions[i].access) IS "public"> <cfset assertTrue("Missing hint on function: #md.functions[i].name#", StructKeyExists(md.functions[i], "hint"))> </cfif> </cfloop> </cfif> </cffunction>
You might need to replace the variables.instance
with an instance of the component you are testing.