diff --git a/example/form-urlencoded/consumer/src/Service/HttpClientService.php b/example/form-urlencoded/consumer/src/Service/HttpClientService.php index 251deeb2..6c02e51d 100644 --- a/example/form-urlencoded/consumer/src/Service/HttpClientService.php +++ b/example/form-urlencoded/consumer/src/Service/HttpClientService.php @@ -36,6 +36,7 @@ public function createUser(): string '?' => 'question-mark', '=' => 'equals-sign', ]) . + '&=first&=second&=third' . '&roles[]=User&roles[]=Manager' . '&orders[]=&orders[]=ASC&orders[]=DESC', 'headers' => [ diff --git a/example/form-urlencoded/consumer/tests/Service/HttpClientServiceTest.php b/example/form-urlencoded/consumer/tests/Service/HttpClientServiceTest.php index 5201690b..83ec21b6 100644 --- a/example/form-urlencoded/consumer/tests/Service/HttpClientServiceTest.php +++ b/example/form-urlencoded/consumer/tests/Service/HttpClientServiceTest.php @@ -38,13 +38,15 @@ public function testGetMovies() $matcher->equal('ASC'), $matcher->equal(''), ]), + // Empty string keys are supported + '' => ['first', 'second', 'third'], // Null, boolean and object values are not supported, so the values and matchers will be ignored 'null' => $matcher->nullValue(), 'boolean' => $matcher->booleanV3(true), 'object' => $matcher->like([ 'key' => $matcher->string('value') ]), - // special characters + // special characters are encoded 'ampersand' => $matcher->equal('&'), 'slash' => '/', 'question-mark' => '?', diff --git a/example/form-urlencoded/pacts/formUrlEncodedConsumer-formUrlEncodedProvider.json b/example/form-urlencoded/pacts/formUrlEncodedConsumer-formUrlEncodedProvider.json index 03a76f7d..d817ed4c 100644 --- a/example/form-urlencoded/pacts/formUrlEncodedConsumer-formUrlEncodedProvider.json +++ b/example/form-urlencoded/pacts/formUrlEncodedConsumer-formUrlEncodedProvider.json @@ -11,7 +11,7 @@ } ], "request": { - "body": "%26=ampersand&%2F=slash&%3D=equals-sign&%3F=question-mark&age=27&agree=false&ersand=%26&email=user%40email.test&empty=&equals-sign=%3D&fullname=User+name&orders%5B%5D=DESC&orders%5B%5D=ASC&orders%5B%5D=&password=user%40password111&question-mark=%3F&roles%5B%5D=User&slash=%2F", + "body": "=first&=second&=third&%26=ampersand&%2F=slash&%3D=equals-sign&%3F=question-mark&age=27&agree=false&ersand=%26&email=user%40email.test&empty=&equals-sign=%3D&fullname=User+name&orders%5B%5D=DESC&orders%5B%5D=ASC&orders%5B%5D=&password=user%40password111&question-mark=%3F&roles%5B%5D=User&slash=%2F", "headers": { "Accept": "application/x-www-form-urlencoded", "Content-Type": "application/x-www-form-urlencoded"