assertCanSeeTableRecords() functions correctly?
Should this pass: "assertCanSeeTableRecords($records)" while $records->count() is zero? It does! Should this pass? "assertCanNotSeeTableRecords($records)"? It does too. Bug?
4 Replies
Technically both are correct. Assert you don’t see anything and assert you see nothing
I don't know. I don't think the language makes it obvious. I think the word "Records" implies there should be at least one record and that failure to pass a record means you've got invalid input to the function, and so it should fail. I also don't like logically that it can pass these opposite pointing functions. These functions feel more like <0 and >0 rather than >=0 and <=0. It did actually catch me out.
Those functions require an argument, so it's "can see those records." I'd agree if they didn't need an argument.
Also if those were called
assertHasRecords and assertDoesNotHaveRecordThanks for your engagement on this. I appreciate your perspective.