PageRenderTime 101ms CodeModel.GetById 40ms app.highlight 0ms RepoModel.GetById 40ms app.codeStats 0ms

/wheels/tests/model/associations/selfjoin.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 18 lines | 14 code | 4 blank | 0 comment | 0 complexity | 1ef4e546eb29749c127b19f3c553ad50 MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cffunction name="setup">
 4		<cfset loc.tagModel = model("tag")>
 5		<cfset loc.postModel = model("post")>
 6	</cffunction>
 7
 8	<cffunction name="test_self_join">
 9		<cfset loc.tag = loc.tagModel.findOne(where="name = 'pear'", include="parent", order="id, id")>
10		<cfset assert("IsObject(loc.tag) and IsObject(loc.tag.parent)")>
11	</cffunction>
12
13	<cffunction name="test_self_join_with_other_associations">
14		<cfset loc.post = loc.postModel.findByKey(key=1, include="classifications(tag(parent))", returnAs="query")>
15		<cfset assert("IsQuery(loc.post) and loc.post.recordcount")>
16	</cffunction>
17
18</cfcomponent>