PageRenderTime 41ms CodeModel.GetById 20ms app.highlight 1ms RepoModel.GetById 19ms 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
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cffunction name="setup">
 4		<cfset loc.controller = controller(name="dummy")>
 5	</cffunction>
 6
 7	<cffunction name="test_with_struct">
 8		<cfset loc.args.objectname = {firstname="tony",lastname="petruzzi"}>
 9		<cfset loc.args.property = "lastname">
10
11		<cfset loc.e = loc.controller.$tagid(argumentcollection=loc.args)>
12		<cfset loc.r = "lastname">
13		<cfset assert("loc.e eq loc.r")>
14
15		<cfset loc.e = loc.controller.$tagname(argumentcollection=loc.args)>
16		<cfset assert("loc.e eq loc.r")>
17	</cffunction>
18
19	<cffunction name="test_with_string">
20		<cfset loc.args.objectname = "wheelsMapping.Test.view.miscellaneous">
21		<cfset loc.args.property = "lastname">
22
23		<cfset loc.e = loc.controller.$tagid(argumentcollection=loc.args)>
24		<cfset loc.r = "miscellaneous-lastname">
25		<cfset assert("loc.e eq loc.r")>
26
27		<cfset loc.e = loc.controller.$tagname(argumentcollection=loc.args)>
28		<cfset loc.r = "miscellaneous[lastname]">
29		<cfset assert("loc.e eq loc.r")>
30	</cffunction>
31
32	<cffunction name="test_with_array">
33		<cfset loc.args.objectname = [1,2,3,4]>
34		<cfset loc.args.property = "lastname">
35
36		<cfset loc.e = loc.controller.$tagid(argumentcollection=loc.args)>
37		<cfset loc.r = "lastname">
38		<cfset assert("loc.e eq loc.r")>
39
40		<cfset loc.e = loc.controller.$tagname(argumentcollection=loc.args)>
41		<cfset assert("loc.e eq loc.r")>
42	</cffunction>
43
44</cfcomponent>