/wheels/tests/model/onmissingmethod/hasone/setobject.cfc
ColdFusion CFScript | 18 lines | 15 code | 3 blank | 0 comment | 0 complexity | 471aa5684526df0bf1e309c4e6410518 MD5 | raw file
Possible License(s): Apache-2.0, CPL-1.0
- <cfcomponent extends="wheelsMapping.Test">
-
- <cffunction name="setup">
- <cfset loc.authorModel = model("author")>
- </cffunction>
-
- <cffunction name="test_setObject_valid">
- <cfset loc.author = loc.authorModel.findOne(where="firstName = 'James'")>
- <cfset loc.profile = model("profile").findOne()>
- <cftransaction action="begin">
- <cfset loc.updated = loc.author.setProfile(loc.profile) />
- <cfset assert('loc.updated eq true')>
- <cfset assert('loc.profile.authorid eq loc.author.id')>
- <cftransaction action="rollback" />
- </cftransaction>
- </cffunction>
-
- </cfcomponent>