Skip to content

Commit

Permalink
chore: Add example for empty key
Browse files Browse the repository at this point in the history
  • Loading branch information
tienvx committed Nov 28, 2024
1 parent c1baf59 commit a27f72d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' => '?',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
],
"request": {
"body": "%26=ampersand&%2F=slash&%3D=equals-sign&%3F=question-mark&age=27&agree=false&ampersand=%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&ampersand=%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"
Expand Down

0 comments on commit a27f72d

Please sign in to comment.