Skip to content

Commit

Permalink
chore: No need manually json encode matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
tienvx committed Feb 9, 2024
1 parent a8949c8 commit 30d4b6f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions example/matchers/consumer/tests/Service/MatchersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,8 @@ public function testGetMatchers(): void
->setMethod('GET')
->setPath($this->matcher->regex('/matchers', '^\/matchers$'))
->setQuery([
'pages' => [ // Consumer send multiple values, but provider receive single (last) value
json_encode($this->matcher->regex([1, 22], '\d+')),
],
'locales[]' => [ // Consumer send multiple values, provider receive all values
json_encode($this->matcher->regex(['en-US', 'en-AU'], '^[a-z]{2}-[A-Z]{2}$')),
],
'pages' => $this->matcher->regex([1, 22], '\d+'), // arrayContains, eachKey, eachValue matchers are not working with query
'locales[]' => $this->matcher->regex(['en-US', 'en-AU'], '^[a-z]{2}-[A-Z]{2}$'), // Use `locales[]` instead of `locales` syntax if provider use PHP language
])
->addHeader('Accept', 'application/json');

Expand Down

0 comments on commit 30d4b6f

Please sign in to comment.