PageRenderTime 19ms CodeModel.GetById 13ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/wheels/tests/model/onmissingmethod/belongsto/object.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 26 lines | 21 code | 5 blank | 0 comment | 0 complexity | 36a84607a76448bdebb85d4ad4922353 MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cffunction name="setup">
 4		<cfset loc.profileModel = model("profile")>
 5		<cfset loc.combiKeyModel = model("combiKey")>
 6	</cffunction>
 7
 8	<cffunction name="test_object_valid">
 9		<cfset loc.profile = loc.profileModel.findByKey(key=1)>
10		<cfset loc.author = loc.profile.author()>
11		<cfset assert("IsObject(loc.author) eq true") />
12	</cffunction>
13 
14 	<cffunction name="test_object_valid_with_combi_key">
15		<cfset loc.combikey = loc.combiKeyModel.findByKey(key="1,1")>
16		<cfset loc.user = loc.combikey.user() />
17		<cfset assert('IsObject(loc.user) eq true')>
18	</cffunction>
19 
20	<cffunction name="test_object_returns_false">
21		<cfset loc.profile = loc.profileModel.findByKey(key=2)>
22		<cfset loc.author = loc.profile.author()>
23		<cfset assert("IsObject(loc.author) eq false") />
24	</cffunction>
25
26</cfcomponent>