From cb83c2e8007a3b755665814dd8fc6cf25fccaed0 Mon Sep 17 00:00:00 2001 From: "tien.xuan.vo" Date: Wed, 17 Jan 2024 22:19:00 +0700 Subject: [PATCH 1/2] deps: Update ffi library to 0.4.13 --- composer.json | 4 ++-- .../pacts/matchersConsumer-matchersProvider.json | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index c83557c9..5f85541f 100644 --- a/composer.json +++ b/composer.json @@ -103,12 +103,12 @@ "extra": { "downloads": { "pact-ffi-headers": { - "version": "0.4.11", + "version": "0.4.13", "url": "https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v{$version}/pact.h", "path": "bin/pact-ffi-headers/pact.h" }, "pact-ffi-lib": { - "version": "0.4.11", + "version": "0.4.13", "variables": { "{$prefix}": "PHP_OS_FAMILY === 'Windows' ? 'pact_ffi' : 'libpact_ffi'", "{$os}": "PHP_OS === 'Darwin' ? 'osx' : strtolower(PHP_OS_FAMILY)", diff --git a/example/matchers/pacts/matchersConsumer-matchersProvider.json b/example/matchers/pacts/matchersConsumer-matchersProvider.json index a9f8dce8..8cd325d0 100644 --- a/example/matchers/pacts/matchersConsumer-matchersProvider.json +++ b/example/matchers/pacts/matchersConsumer-matchersProvider.json @@ -29,21 +29,21 @@ ] }, "query": { - "$.pages": { + "locales[]": { "combine": "AND", "matchers": [ { "match": "regex", - "regex": "\\d+" + "regex": "^[a-z]{2}-[A-Z]{2}$" } ] }, - "$['locales[]']": { + "pages": { "combine": "AND", "matchers": [ { "match": "regex", - "regex": "^[a-z]{2}-[A-Z]{2}$" + "regex": "\\d+" } ] } @@ -591,9 +591,9 @@ ], "metadata": { "pactRust": { - "ffi": "0.4.11", + "ffi": "0.4.13", "mockserver": "1.2.4", - "models": "1.1.12" + "models": "1.1.16" }, "pactSpecification": { "version": "4.0" From d08322d39215be1056296853bf0dfb8a67d8c456 Mon Sep 17 00:00:00 2001 From: "tien.xuan.vo" Date: Fri, 19 Jan 2024 13:52:10 +0700 Subject: [PATCH 2/2] test(compatibility-suite): Fix error 'Matching rule JSON [] is not correctly formed' --- compatibility-suite/tests/Context/V3/Http/ProviderContext.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compatibility-suite/tests/Context/V3/Http/ProviderContext.php b/compatibility-suite/tests/Context/V3/Http/ProviderContext.php index 85d6e460..4dfad0ae 100644 --- a/compatibility-suite/tests/Context/V3/Http/ProviderContext.php +++ b/compatibility-suite/tests/Context/V3/Http/ProviderContext.php @@ -28,9 +28,9 @@ public function __construct( public function aPactFileForInteractionIsToBeVerifiedWithTheFollowingProviderStatesDefined(int $id, TableNode $table): void { $this->pactWriter->write($id, $this->pactPath); - $pact = json_decode(file_get_contents($this->pactPath), true); + $pact = json_decode(file_get_contents($this->pactPath)); $rows = $table->getHash(); - $pact['interactions'][0]['providerStates'] = array_map(fn (array $row): array => ['name' => $row['State Name'], 'params' => json_decode($row['Parameters'] ?? '{}', true)], $rows); + $pact->interactions[0]->providerStates = array_map(fn (array $row): array => ['name' => $row['State Name'], 'params' => json_decode($row['Parameters'] ?? '{}', true)], $rows); file_put_contents($this->pactPath, json_encode($pact)); $this->providerVerifier->addSource($this->pactPath); }