Skip to content
This repository was archived by the owner on Apr 20, 2021. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/Context/RestContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,10 @@ public function iSendARequestToWithParameters($method, $url, TableNode $data)
$files[$row['key']] = rtrim($this->getMinkParameter('files_path'), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.substr($row['value'],1);
}
else {
$parameters[] = sprintf('%s=%s', $row['key'], $row['value']);
$parameters[$row['key']] = $row['value'];
}
}

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

return $this->request->send(
$method,
$this->locatePath($url),
Expand Down
7 changes: 7 additions & 0 deletions tests/features/rest.feature
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ Feature: Testing RESTContext
"""
Then the response should be empty

Scenario: request parameter with dot
https://github.com/Behatch/contexts/issues/256
When I send a POST request to "/rest/index.php" with parameters:
| key | value |
| item.id | 1 |
Then I should see "item.id=1"

Scenario: Add header
Given I add "xxx" header equal to "yyy"
When I send a GET request to "/rest/index.php"
Expand Down