/wheels/tests/model/onmissingmethod/hasMany/removeallobjects.cfc
ColdFusion CFScript | 18 lines | 15 code | 3 blank | 0 comment | 0 complexity | 1dcb178ebd25e94a05d6405d26460d2a 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_removeAllObjects_valid">
- <cfset loc.author = loc.authorModel.findOne(where="firstName = 'Per'")>
- <cftransaction action="begin">
- <cfset loc.updated = loc.author.removeAllPosts() />
- <cfset loc.posts = loc.author.posts() />
- <cfset assert('IsNumeric(loc.updated) and loc.updated eq 3')>
- <cfset assert('IsQuery(loc.posts) eq true and not loc.posts.Recordcount')>
- <cftransaction action="rollback" />
- </cftransaction>
- </cffunction>
-
- </cfcomponent>