PageRenderTime 32ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/wheels/tests/model/calculations/minimum.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 27 lines | 22 code | 5 blank | 0 comment | 0 complexity | 936296b6794001f0e6a79512f6fede49 MD5 | raw file
Possible License(s): Apache-2.0, CPL-1.0
  1. <cfcomponent extends="wheelsMapping.Test">
  2. <cffunction name="test_minimum">
  3. <cfset loc.result = model("post").minimum(property="views")>
  4. <cfset assert("loc.result IS 0")>
  5. </cffunction>
  6. <cffunction name="test_minimum_with_non_matching_where">
  7. <cfset loc.result = model("post").minimum(property="views", where="id=0")>
  8. <cfset assert("loc.result IS ''")>
  9. </cffunction>
  10. <cffunction name="test_minimum_with_ifNull">
  11. <cfset loc.result = model("post").minimum(property="views", where="id=0", ifNull=0)>
  12. <cfset assert("loc.result IS 0")>
  13. </cffunction>
  14. <cffunction name="test_minimum_with_include_soft_deletes">
  15. <cftransaction action="begin">
  16. <cfset loc.post = model("Post").deleteAll(where="views=0", transaction="none")>
  17. <cfset loc.minimum = model("Post").minimum(property="views", includeSoftDeletes=true)>
  18. <cftransaction action="rollback" />
  19. </cftransaction>
  20. <cfset assert('loc.minimum eq 0')>
  21. </cffunction>
  22. </cfcomponent>