Skip to content
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

Method Illuminate\Http\JsonResponse::statusMessageWithValidationErrors does not exist. #38159

Closed
ozanhazer opened this issue Jul 28, 2021 · 1 comment

Comments

@ozanhazer
Copy link

  • Laravel Version: 8.52.0
  • PHP Version: 8.0.8
  • Database Driver & Version:

Description:

BadMethodCallException is thrown when assertStatus(422) is used. There's a leftover after refactoring done in #38088 :

    protected function statusMessageWithException($expected, $actual, $exception)
    {
        if ($exception instanceof ValidationException) {
            return $this->statusMessageWithValidationErrors($expected, $actual, $exception);
        }

Apparently statusMessageWithValidationErrors method was removed but I think forgotten here..

Steps To Reproduce:

Create a unit test and check for 422 status:

$this->post('/some-endpoint', ['foo' => 'bar'])->assertStatus(422);

@themsaid
Copy link
Member

fixed cde3662

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants