How do I unit test a function which returns a query?

17 Views Asked by At

I'm using Propel ORM and I have a function which returns a query, I want to write unit tests for it to check if it spits out the correct query. I can create mock tables and then check if they the results of running the query are the same but I wonder if there's a better way.

I use Propel ORM.

Things that I tried:

String comparing the queries, doesn't work because I get parametrised query.

Any ideas?

0

There are 0 best solutions below