Uh oh!
There was an error while loading. Please reload this page.
[POC] Add Expectation::isJson() to verify json string and decode - #19
[POC] Add Expectation::isJson() to verify json string and decode#19kbond wants to merge 1 commit into
Expectation::isJson() to verify json string and decode#19Conversation
kbond
commented
Jul 11, 2022
Not sure we want to do this but wanted to capture our conversation with a POC. We could go even further and move the |
Uh oh!
There was an error while loading. Please reload this page.
| * | ||
| * Fails if not a valid json string. | ||
| */ | ||
| public function isJson(): self |
There was a problem hiding this comment.
not sure of the name: it sounds like it's just an expectation, but it does more... decodeJson() ?
There was a problem hiding this comment.
Yeah, this tripped me up as well. Technically it is also an expectation but is not clear that it changes the underlying data.
I chose this purely because the api reads better: "assert that value is json" vs "assert that value decode json". I definitely probably get too hung up on these semantics 😄.
Per a slack discussion with @nikophil.