You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When testing presenters, I create a Nette\Application\Request and let the presenter run it. However, this way the ResourcePresenter::input doesn't contain the POST data sent in the request.
I did some research and found that InputFactory parses POST data from Nette\Http\Request, which is fine when using the API via HTTP calls.
I can make a PR, where Nette\Application\Request would get injected into the InputFactory and the POST data would be extracted from it, rather than from Nette\Http\Request. Do you think this would be a good solution?
The text was updated successfully, but these errors were encountered:
The main purpose of Input factory is to actually parse the request body using mapper (according to Content-Type header). The request body may be in various formats (such as JSON). Getting data from Application Request would work for data URL format only.
Possible solution would be to add Input factory interface so you can create your own input factory for tests.
When testing presenters, I create a
Nette\Application\Request
and let the presenter run it. However, this way theResourcePresenter::input
doesn't contain the POST data sent in the request.I did some research and found that
InputFactory
parses POST data fromNette\Http\Request
, which is fine when using the API via HTTP calls.I can make a PR, where
Nette\Application\Request
would get injected into theInputFactory
and the POST data would be extracted from it, rather than fromNette\Http\Request
. Do you think this would be a good solution?The text was updated successfully, but these errors were encountered: