You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hoping that it would generate the following query SELECT count(*) FROM someTable WHERE foo IN ('cond1', 'cond2', 'cond3') and assert that the result must be 0. However I ended up getting an exception, saying array-to-string conversion - obviously enough since this is not supported.
Do you think this is something good to have, or just bad test design on my part?
Codeception version: 2.3.3
The text was updated successfully, but these errors were encountered:
This is hard to argue about. I have seen such custom method in past projects as well. From a strict perspective I would not recommend it. It is convenient to use, although the IN command in SQL will query for all given conditions.
TL;TR: When you have different conditions I would advise to either write a custom method or query for each of them individually. Maybe a wildcard condition might for your scenario as well.
Hey @kvelicheti, was a long ago - but I think I just ended up going with multiple dontSeeInDatabase conditions, wrapped in some helper method.
Good luck with your testing! :)
What are you trying to achieve?
I wanted to check that
$I->dontSeeInDatabase
from a list of values. Instead of writingI ended up writing
hoping that it would generate the following query
SELECT count(*) FROM someTable WHERE foo IN ('cond1', 'cond2', 'cond3')
and assert that the result must be 0. However I ended up getting an exception, saying array-to-string conversion - obviously enough since this is not supported.Do you think this is something good to have, or just bad test design on my part?
The text was updated successfully, but these errors were encountered: