PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 2ms 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
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cffunction name="setup">
 4		<cfset loc.controller = controller(name="dummy")>
 5		<cfset loc.args = {}>
 6		<cfset loc.args.text = "CFWheels test to do see if hightlight function works or not.">
 7		<cfset loc.args.phrases = "hightlight function">
 8		<cfset loc.args.class = "cfwheels-hightlight">
 9	</cffunction>
10
11	<cffunction name="test_phrase_found">
12		<cfset loc.e = loc.controller.highlight(argumentcollection=loc.args)>
13		<cfset loc.r = 'CFWheels test to do see if <span class="cfwheels-hightlight">hightlight function</span> works or not.'>
14		<cfset assert("loc.e eq loc.r")>
15	</cffunction>
16
17	<cffunction name="test_phrase_not_found">
18		<cfset loc.args.phrases = "xxxxxxxxx">
19		<cfset loc.e = loc.controller.highlight(argumentcollection=loc.args)>
20		<cfset loc.r = 'CFWheels test to do see if hightlight function works or not.'>
21		<cfset assert("loc.e eq loc.r")>
22	</cffunction>
23
24	<cffunction name="test_phrase_found_no_class_defined">
25		<cfset structdelete(loc.args, "class")>
26		<cfset loc.args.phrases = "hightlight function">
27		<cfset loc.e = loc.controller.highlight(argumentcollection=loc.args)>
28		<cfset loc.r = 'CFWheels test to do see if <span class="highlight">hightlight function</span> works or not.'>
29		<cfset assert("loc.e eq loc.r")>
30	</cffunction>
31
32	<cffunction name="test_phrase_not_found_no_class_defined">
33		<cfset loc.args.phrases = "xxxxxxxxx">
34		<cfset loc.e = loc.controller.highlight(argumentcollection=loc.args)>
35		<cfset loc.r = 'CFWheels test to do see if hightlight function works or not.'>
36		<cfset assert("loc.e eq loc.r")>
37	</cffunction>
38
39</cfcomponent>