PageRenderTime 295ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/wheels/tests/model/callbacks/afterDelete.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 28 lines | 23 code | 5 blank | 0 comment | 0 complexity | d85f9155953b84f4b96d9f420dde7713 MD5 | raw file
Possible License(s): Apache-2.0, CPL-1.0
  1. <cfcomponent extends="wheelsMapping.Test">
  2. <cffunction name="setup">
  3. <cfset model("tag").$registerCallback(type="afterDelete", methods="callbackThatSetsProperty")>
  4. <cfset loc.obj = model("tag").findOne()>
  5. </cffunction>
  6. <cffunction name="teardown">
  7. <cfset model("tag").$clearCallbacks(type="afterDelete")>
  8. </cffunction>
  9. <cffunction name="test_existing_object">
  10. <cftransaction>
  11. <cfset loc.obj.delete(transaction="none")>
  12. <cftransaction action="rollback"/>
  13. </cftransaction>
  14. <cfset assert("StructKeyExists(loc.obj, 'setByCallback')")>
  15. </cffunction>
  16. <cffunction name="test_existing_object_with_skipped_callback">
  17. <cftransaction>
  18. <cfset loc.obj.delete(transaction="none", callbacks="false")>
  19. <cftransaction action="rollback"/>
  20. </cftransaction>
  21. <cfset assert("NOT StructKeyExists(loc.obj, 'setByCallback')")>
  22. </cffunction>
  23. </cfcomponent>