Skip to content
This repository was archived by the owner on Apr 20, 2021. It is now read-only.
This repository was archived by the owner on Apr 20, 2021. It is now read-only.

Rest Context - Send Request with Parameters Bug #256

@mab05k

Description

@mab05k

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 this

Then I send a "GET" request to "/endpoint" with parameters:
| key        | value |
| item.id    | 1     |

The function uses this snippet:

parse_str(implode('&', $parameters), $parameters);

which transforms my query parameter to item_id and my API ignores this and tests don't run properly. The function parse_str cannot create variables with a . because this is illegal in PHP.

The snippet that creates the $parameters array could be updated from

$parameters[] = sprintf('%s=%s', $row['key'], $row['value']);

to

$parameters[$row['key']] = $row['value'];

and we can remove this (which seems to be an unnecessary manipulation of the data passed into the function)

parse_str(implode('&', $parameters), $parameters);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions