Closed
Description
Laravel Version
12.9.1
PHP Version
8.4
Database Driver & Version
No response
Description
Context: In my tests, I wanted to replace all my assertInvalid
assertions by assertOnlyInvalid
then specify validation messages so I played around with parameters and tried to see if I could get away with doing assertOnlyInvalid('field', __('message'))
instead of passing an array.
But I found the following a bit weird:
I know this is not the proper way to use this method but that test still passes. In this example, the anomaly is pretty obvious (w/ typos and random letters) but let's say we're an innocent dev and tried the following:
Obviously, there's no validation message with this key.
Since the test is passing and it looks okay to our eyes, it would pass by our radar.
Steps To Reproduce
- Install any Starter Kit, I used the React one here.
- Pick any test with
assertSessionHasErrors
and replace it withassertOnlyInvalid
- Pass several arguments to it (do not use an array)