From 30d4b6fa3126a674501e370b3324a2ae4f477b59 Mon Sep 17 00:00:00 2001 From: "tien.xuan.vo" Date: Fri, 9 Feb 2024 17:14:45 +0700 Subject: [PATCH] chore: No need manually json encode matcher --- example/matchers/consumer/tests/Service/MatchersTest.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/example/matchers/consumer/tests/Service/MatchersTest.php b/example/matchers/consumer/tests/Service/MatchersTest.php index 4cf76940..c464277e 100644 --- a/example/matchers/consumer/tests/Service/MatchersTest.php +++ b/example/matchers/consumer/tests/Service/MatchersTest.php @@ -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');