Closed mab05k closed 6 years ago
Your suggestion is a good idea, but it probably doesn’t resolve your issue: the parameters is not sent for GET
and HEAD
requests https://github.com/FriendsOfPHP/Goutte/blob/master/Goutte/Client.php#L152
I see. However, I'm using the Symfony2Extension, so we're using the Symfony Client for the requests which doesn't exclude GET and HEAD.
https://github.com/symfony/http-kernel/blob/master/Client.php#L68
Could this change potentially break something for Goutte? I'm not familiar enough with it.
Can you test this modification https://github.com/Behatch/contexts/pull/258 ?
Sorry for the delay @sanpii . Works as expected, thanks!!
Unfortunately this broke the ability to send array parameters in get requests, which worked before, eg.
Given I send a "GET" request to "/some-url" with parameters:
| key | value |
| param1 | val1 |
| param2[] | val2 |
is now equivalent to:
$parameters = ['param1' => 'val1', 'param2[]' => 'val2'];
while before this translated to:
$parameters = ['param1' => 'val1', 'param2' => [0 => 'val2']];
I am attempting to use the Gherkin statement
@Given I send a :method request to :url with parameters:
. I have a query parameter that has a.
in it,item.id
, so I create the table node like thisThe function uses this snippet:
which transforms my query parameter to
item_id
and my API ignores this and tests don't run properly. The functionparse_str
cannot create variables with a.
because this is illegal in PHP.The snippet that creates the
$parameters
array could be updated fromto
and we can remove this (which seems to be an unnecessary manipulation of the data passed into the function)