liip / liip/LiipFunctionalTestBundle
Allow passing server parameters on form submit
- Dominant language
- PHP
- Stars
- 648
- Forks
- 179
- PR merge metrics
- No merged PRs in 30d
Description
When you do something like this:
```php
$form = $crawler->selectButton('Submit')->form();
$crawler = $client->submit($form, [
'foo' => 'bar',
]);
```
You can't pass any server value. But it can be useful, for example, to passe XHR header: https://stackoverflow.com/a/9505494/1731473
Current possible workaround:
```php
$crawler = $client->request($form->getMethod(), $form->getUri(), $form->getPhpValues(), $form->getPhpFiles(), [
'HTTP_X-Requested-With' => 'XMLHttpRequest',
]);
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the client submit API and comparing it with the request workaround shown in the issue, including getMethod(), getUri(), getPhpValues(), getPhpFiles(), and server parameters. Done means submit accepts server values such as HTTP_X-Requested-With and forwards them while preserving the existing form data behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, symfony
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100