-
-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Match a multi argument query against an expectation with an unique argument(s) #26
Comments
Hi, there is an example with unordered matching. I think that will manage your use case. |
Thanks! That I think solves part of my problem, the other bit is how I differentiate between two queries without specifying all of the arguments? |
You may catch it by regular expression on SQL without providing any argument, in that case you need to know how many of these queries will be run and just add expectations in a loop only on SQL statement. If you provide at least one argument, only in that case arguments are being matched. Nothing prevents you from expecting SQL query like: |
Sure, but in the case that my query is |
Ah, in that case you should use custom argument matcher for one which differs and you do not care about. |
I'm hitting an issue where I want to mock a query but I don't know about (or in my particular case; don't care about) some of the arguments that the query was made with. I Also don't know what order the queries are made in
consider this somewhat convoluted example:
https://gist.github.com/nicwest/f902199d47f5c4a7902a
I would like to do something along the lines of
Any suggestions?
The text was updated successfully, but these errors were encountered: