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

Commit

Permalink
Merge branch 'behatch-rest-dot-parameters'
Browse files Browse the repository at this point in the history
  • Loading branch information
sanpii committed Aug 13, 2018
2 parents 9b342b2 + a585f0b commit cbda31e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
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

0 comments on commit cbda31e

Please sign in to comment.