Skip to content

Commit cbda31e

Browse files
committed
Merge branch 'behatch-rest-dot-parameters'
2 parents 9b342b2 + a585f0b commit cbda31e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/Context/RestContext.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,10 @@ public function iSendARequestToWithParameters($method, $url, TableNode $data)
5454
$files[$row['key']] = rtrim($this->getMinkParameter('files_path'), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.substr($row['value'],1);
5555
}
5656
else {
57-
$parameters[] = sprintf('%s=%s', $row['key'], $row['value']);
57+
$parameters[$row['key']] = $row['value'];
5858
}
5959
}
6060

61-
parse_str(implode('&', $parameters), $parameters);
62-
6361
return $this->request->send(
6462
$method,
6563
$this->locatePath($url),

tests/features/rest.feature

+7
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ Feature: Testing RESTContext
5151
"""
5252
Then the response should be empty
5353

54+
Scenario: request parameter with dot
55+
https://github.com/Behatch/contexts/issues/256
56+
When I send a POST request to "/rest/index.php" with parameters:
57+
| key | value |
58+
| item.id | 1 |
59+
Then I should see "item.id=1"
60+
5461
Scenario: Add header
5562
Given I add "xxx" header equal to "yyy"
5663
When I send a GET request to "/rest/index.php"

0 commit comments

Comments
 (0)