Hi, Anyone tested Pact with `application/x-www-fo...
# libpact_ffi-users
t
Hi, Anyone tested Pact with
application/x-www-form-urlencoded
? Does it support matchers? I try to test it here https://github.com/pact-foundation/pact-php/pull/627, but from the log, look like it doesn't support matchers:
Copy code
2024-08-30T08:38:28.146149Z DEBUG tokio-runtime-worker pact_mock_server::hyper_server: Request did not match: Request did not match - HTTP Request ( method: POST, path: /users, query: None, headers: Some({"Accept": ["application/json"], "Content-Type": ["application/x-www-form-urlencoded"]}), body: Present(287 bytes) )    0) $.^_-]{8,}$","value":"user@password111"}} -> Expected form post parameter '^_-]{8,}$","value":"user@password111"}}' but was missing    1) $.email -> Unexpected form post parameter 'email' received    2) $.password -> Unexpected form post parameter 'password' received    3) $.{"fullname":{"pact:matcher:type":"type","value":"User name"},"email":{"pact:matcher:type":"regex","regex":"^[a-zA-Z0-9._% -] @[a-zA-Z0-9.-] .[a-zA-Z]{2,}$","value":"user@email.test"},"password":{"pact:matcher:type":"regex","regex":"^[\\w\\d@$!%*#? -> Expected form post parameter '{"fullname":{"pact:matcher:type":"type","value":"User name"},"email":{"pact:matcher:type":"regex","regex":"^[a-zA-Z0-9._% -] @[a-zA-Z0-9.-] .[a-zA-Z]{2,}$","value":"user@email.test"},"password":{"pact:matcher:type":"regex","regex":"^[\\w\\d@$!%*#?' but was missing    4) $.fullname -> Unexpected form post parameter 'fullname' received
m
I don't recall matchers working with anything other than JSON
t
look like we need to create a new
form_urlencoded
plugin to use matchers in
application/x-www-form-urlencoded
https://github.com/pact-foundation/pact-js/issues/767#issuecomment-961556899