We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87eb9a0 commit 2970dabCopy full SHA for 2970dab
1 file changed
src/Illuminate/Foundation/Testing/TestResponse.php
@@ -657,9 +657,13 @@ public function assertJsonValidationErrors($errors)
657
);
658
659
if (! is_int($key)) {
660
- PHPUnit::assertStringContainsString(
661
- $value,
662
- $jsonErrors[$key],
+ foreach (Arr::wrap($jsonErrors[$key]) as $jsonErrorMessage) {
+ if (Str::contains($jsonErrorMessage, $value)) {
+ return $this;
663
+ }
664
665
+
666
+ PHPUnit::fail(
667
"Failed to find a validation error in the response for key and message: '$key' => '$value'".PHP_EOL.PHP_EOL.$errorMessage
668
669
}
0 commit comments