8000 [11.x] Fix missing `return $this` for `assertOnlyJsonValidationErrors` by LeTamanoir · Pull Request #55099 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content

[11.x] Fix missing return $this for assertOnlyJsonValidationErrors #55099

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8000
2 changes: 2 additions & 0 deletions src/Illuminate/Testing/TestResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,8 @@ public function assertOnlyJsonValidationErrors($errors, $responseKey = 'errors')
$unexpectedErrorKeys = Arr::except($jsonErrors, $expectedErrorKeys);

PHPUnit::withResponse($this)->assertTrue(count($unexpectedErrorKeys) === 0, 'Response has unexpected validation errors: '.collect($unexpectedErrorKeys)->keys()->map(fn ($key) => "'{$key}'")->join(', '));

return $this;
}

/**
Expand Down
Loading
0