pact-foundation / pact-php

PHP version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project
Apache License 2.0
273 stars 92 forks source link

Nested array as passed params in given state #690

Closed judimator closed 2 weeks ago

judimator commented 2 weeks ago

Hi there,

I am wondering is there a chance to pass nested array as params. Currently it supports only array<string, string> params.

Code to reproduce

$config = new MockServerEnvConfig();
$builder = new InteractionBuilder($config);
$builder
    ->given('User exist', [
        'date' => [
            'id' => 1,
            ...
        ],
        'meta' => [],
    ])
    ...

Version

pact-php:10.0.0

tienvx commented 2 weeks ago

Thank @judimator for reporting the issue. This feature will be available in 10.1

judimator commented 2 weeks ago

@tienvx Thanks! Would you tell me when you gonna perform that release?

tienvx commented 2 weeks ago

I can't say for sure, but it may happen within 2 weeks. Would you like an alpha version to try it out?

judimator commented 2 weeks ago

@tienvx Yeah, why not, but I didn't find alpha among all releases...

tienvx commented 2 weeks ago

I released a new version. You can try it out using the tag 10.1.0-beta1