Skip to content

Form submit integration tests fail after PSR request changes #48828

Closed
@pjordaan

Description

@pjordaan

Laravel Version

10.29

PHP Version

8.1

Database Driver & Version

No response

Description

A few of my integration tests in my project failed with 10.29, no issues in 10.28. I use PSR request in my controllers for being framework agnostic.

I also have a few integration tests that test a form submit. A form submit POST body does not contain JSON, but url encoded (http_build_query). It seems that after the fix for #48696 an error is thrown on getPayload() as it tries to parse the url encoded POST body as JSON.

It could be this should be fixed in symfony/symfony since this issue is related to getPayload() not checking content types.

Steps To Reproduce

Make an integration tests and use a POST body with http_build_query and not JSON. The content-type header should be application/x-www-form-urlencoded. The controller it is testing is using ServerRequestInterface as typehint.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions