PageRenderTime 139ms CodeModel.GetById 0ms RepoModel.GetById 0ms 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
Possible License(s): Apache-2.0, CPL-1.0
  1. <cfcomponent extends="wheelsMapping.Test">
  2. <cffunction name="setup">
  3. <cfset loc.profileModel = model("profile")>
  4. <cfset loc.combiKeyModel = model("combiKey")>
  5. </cffunction>
  6. <cffunction name="test_object_valid">
  7. <cfset loc.profile = loc.profileModel.findByKey(key=1)>
  8. <cfset loc.author = loc.profile.author()>
  9. <cfset assert("IsObject(loc.author) eq true") />
  10. </cffunction>
  11. <cffunction name="test_object_valid_with_combi_key">
  12. <cfset loc.combikey = loc.combiKeyModel.findByKey(key="1,1")>
  13. <cfset loc.user = loc.combikey.user() />
  14. <cfset assert('IsObject(loc.user) eq true')>
  15. </cffunction>
  16. <cffunction name="test_object_returns_false">
  17. <cfset loc.profile = loc.profileModel.findByKey(key=2)>
  18. <cfset loc.author = loc.profile.author()>
  19. <cfset assert("IsObject(loc.author) eq false") />
  20. </cffunction>
  21. </cfcomponent>