PageRenderTime 34ms CodeModel.GetById 11ms RepoModel.GetById 1ms app.codeStats 0ms

/wheels/tests/view/text/highlight.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 39 lines | 33 code | 6 blank | 0 comment | 4 complexity | cb8675dc8dcfcbec131416d58b4c3f31 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.text = "CFWheels test to do see if hightlight function works or not.">
  6. <cfset loc.args.phrases = "hightlight function">
  7. <cfset loc.args.class = "cfwheels-hightlight">
  8. </cffunction>
  9. <cffunction name="test_phrase_found">
  10. <cfset loc.e = loc.controller.highlight(argumentcollection=loc.args)>
  11. <cfset loc.r = 'CFWheels test to do see if <span class="cfwheels-hightlight">hightlight function</span> works or not.'>
  12. <cfset assert("loc.e eq loc.r")>
  13. </cffunction>
  14. <cffunction name="test_phrase_not_found">
  15. <cfset loc.args.phrases = "xxxxxxxxx">
  16. <cfset loc.e = loc.controller.highlight(argumentcollection=loc.args)>
  17. <cfset loc.r = 'CFWheels test to do see if hightlight function works or not.'>
  18. <cfset assert("loc.e eq loc.r")>
  19. </cffunction>
  20. <cffunction name="test_phrase_found_no_class_defined">
  21. <cfset structdelete(loc.args, "class")>
  22. <cfset loc.args.phrases = "hightlight function">
  23. <cfset loc.e = loc.controller.highlight(argumentcollection=loc.args)>
  24. <cfset loc.r = 'CFWheels test to do see if <span class="highlight">hightlight function</span> works or not.'>
  25. <cfset assert("loc.e eq loc.r")>
  26. </cffunction>
  27. <cffunction name="test_phrase_not_found_no_class_defined">
  28. <cfset loc.args.phrases = "xxxxxxxxx">
  29. <cfset loc.e = loc.controller.highlight(argumentcollection=loc.args)>
  30. <cfset loc.r = 'CFWheels test to do see if hightlight function works or not.'>
  31. <cfset assert("loc.e eq loc.r")>
  32. </cffunction>
  33. </cfcomponent>