PageRenderTime 43ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/wheels/tests/view/miscellaneous/resetcycle.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 30 lines | 26 code | 4 blank | 0 comment | 0 complexity | ff30b30ccddc768ac37b9012934c3696 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. <cfset loc.args = {}>
  5. <cfset loc.args.values = "1,2,3,4,5,6">
  6. <cfset loc.args.name = "cycle_test_2">
  7. <cfset loc.container = listtoarray(loc.args.values)>
  8. </cffunction>
  9. <cffunction name="test_named">
  10. <cfloop array="#loc.container#" index="loc.r">
  11. <cfset loc.controller.cycle(argumentcollection=loc.args)>
  12. </cfloop>
  13. <cfset assert("request.wheels.cycle[loc.args.name] eq 6")>
  14. <cfset loc.controller.resetcycle(loc.args.name)>
  15. <cfset assert("not structkeyexists(request.wheels.cycle, loc.args.name)")>
  16. </cffunction>
  17. <cffunction name="test_not_named">
  18. <cfset structdelete(loc.args, "name")>
  19. <cfloop array="#loc.container#" index="loc.r">
  20. <cfset loc.controller.cycle(argumentcollection=loc.args)>
  21. </cfloop>
  22. <cfset assert("request.wheels.cycle['default'] eq 6")>
  23. <cfset loc.controller.resetcycle()>
  24. <cfset assert("not isdefined('request.wheels.cycle.default')")>
  25. </cffunction>
  26. </cfcomponent>