You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
Thanks for this awesome library, it is really cool!
I have found one bug after upgrading mcustiel/phiremock 1.12.1 to 2.1.1 and installing mcustiel/phiremock-client 1.1.2
In my code I make request with following json body {"amount": 2000.0}
I use symfony/http-client, which json encodes body with following flags JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_PRESERVE_ZERO_FRACTION (I can't change them, they are hardcoded in symfony/http-client)
In my tests I make such assertion (I use codeception)
But it always fails.
After some debugging I realized that the problem is in \Mcustiel\Phiremock\Domain\Condition\Json. In constructor json string is decoded to array and in asString it is json_encoded again. But it json_encoded without my flags (especially JSON_PRESERVE_ZERO_FRACTION) and 2000.0 becomes 2000
Could we save original value passed in Json constructor in separate field and simply return it in asString method? That will help
The text was updated successfully, but these errors were encountered:
Hi
Thanks for this awesome library, it is really cool!
I have found one bug after upgrading
mcustiel/phiremock 1.12.1 to 2.1.1
and installingmcustiel/phiremock-client 1.1.2
In my code I make request with following json body
{"amount": 2000.0}
I use
symfony/http-client
, which json encodes body with following flagsJSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_PRESERVE_ZERO_FRACTION
(I can't change them, they are hardcoded insymfony/http-client
)In my tests I make such assertion (I use codeception)
But it always fails.
After some debugging I realized that the problem is in
\Mcustiel\Phiremock\Domain\Condition\Json
. In constructor json string is decoded to array and inasString
it is json_encoded again. But it json_encoded without my flags (especiallyJSON_PRESERVE_ZERO_FRACTION
) and2000.0
becomes2000
Could we save original value passed in Json constructor in separate field and simply return it in
asString
method? That will helpThe text was updated successfully, but these errors were encountered: