/wheels/tests/model/onmissingmethod/hasMany/deleteallobjects.cfc
ColdFusion CFScript | 18 lines | 15 code | 3 blank | 0 comment | 0 complexity | 08a769951fb6cb117f29db04d74a8366 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_deleteAllObjects_valid">
- <cfset loc.author = loc.authorModel.findOne(where="firstName = 'Per'")>
- <cftransaction action="begin">
- <cfset loc.updated = loc.author.deleteAllPosts() />
- <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>