PageRenderTime 162ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/wheels/tests/view/miscellaneous/$tagId_and_$tagName.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 44 lines | 33 code | 11 blank | 0 comment | 0 complexity | 0f3d77fb451f85caf2c3c18f36cbcb02 MD5 | raw file
Possible License(s): Apache-2.0, CPL-1.0
  1. <cfcomponent extends="wheelsMapping.Test">
  2. <cffunction name="setup">
  3. <cfset loc.controller = controller(name="dummy")>
  4. </cffunction>
  5. <cffunction name="test_with_struct">
  6. <cfset loc.args.objectname = {firstname="tony",lastname="petruzzi"}>
  7. <cfset loc.args.property = "lastname">
  8. <cfset loc.e = loc.controller.$tagid(argumentcollection=loc.args)>
  9. <cfset loc.r = "lastname">
  10. <cfset assert("loc.e eq loc.r")>
  11. <cfset loc.e = loc.controller.$tagname(argumentcollection=loc.args)>
  12. <cfset assert("loc.e eq loc.r")>
  13. </cffunction>
  14. <cffunction name="test_with_string">
  15. <cfset loc.args.objectname = "wheelsMapping.Test.view.miscellaneous">
  16. <cfset loc.args.property = "lastname">
  17. <cfset loc.e = loc.controller.$tagid(argumentcollection=loc.args)>
  18. <cfset loc.r = "miscellaneous-lastname">
  19. <cfset assert("loc.e eq loc.r")>
  20. <cfset loc.e = loc.controller.$tagname(argumentcollection=loc.args)>
  21. <cfset loc.r = "miscellaneous[lastname]">
  22. <cfset assert("loc.e eq loc.r")>
  23. </cffunction>
  24. <cffunction name="test_with_array">
  25. <cfset loc.args.objectname = [1,2,3,4]>
  26. <cfset loc.args.property = "lastname">
  27. <cfset loc.e = loc.controller.$tagid(argumentcollection=loc.args)>
  28. <cfset loc.r = "lastname">
  29. <cfset assert("loc.e eq loc.r")>
  30. <cfset loc.e = loc.controller.$tagname(argumentcollection=loc.args)>
  31. <cfset assert("loc.e eq loc.r")>
  32. </cffunction>
  33. </cfcomponent>