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

/wheels/tests/model/crud/findall.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 29 lines | 24 code | 5 blank | 0 comment | 0 complexity | 7715d88f1e8257b7c89aef367fbaa81d MD5 | raw file
Possible License(s): Apache-2.0, CPL-1.0
  1. <cfcomponent extends="wheelsMapping.Test">
  2. <cffunction name="setup">
  3. <cfset loc.source = model("user").findAll(select="id,lastName", maxRows=3)>
  4. </cffunction>
  5. <cffunction name="test_in_operator_with_quoted_strings">
  6. <cfset loc.values = QuotedValueList(loc.source.lastName)>
  7. <cfset loc.q = model("user").findAll(where="lastName IN (#loc.values#)")>
  8. <cfset assert('loc.q.recordCount IS 3')>
  9. </cffunction>
  10. <cffunction name="test_in_operator_with_numbers">
  11. <cfset loc.values = ValueList(loc.source.id)>
  12. <cfset loc.q = model("user").findAll(where="id IN (#loc.values#)")>
  13. <cfset assert('loc.q.recordCount IS 3')>
  14. </cffunction>
  15. <cffunction name="test_custom_query_and_orm_query_in_transaction">
  16. <cftransaction>
  17. <cfquery name="loc.resultOne" datasource="#application.wheels.dataSourceName#">
  18. SELECT id FROM users
  19. </cfquery>
  20. <cfset loc.resultTwo = model("user").findAll(select="id")>
  21. </cftransaction>
  22. <cfset assert("loc.resultOne.recordCount IS loc.resultTwo.recordCount")>
  23. </cffunction>
  24. </cfcomponent>