imbo / behat-api-extension

API extension for Behat, used to ease testing of JSON-based APIs
MIT License
109 stars 42 forks source link

Check individual payload properties instead of whole array #62

Closed Zwartpet closed 6 years ago

Zwartpet commented 7 years ago

Its almost impossible to test generated payload values like the expired the way the JWT matcher works. I suggest checking the properties that are given in the jwt token you want to check.

Zwartpet commented 7 years ago

Created new pull request because I messed up my own fork.

christeredvartsen commented 7 years ago

How about we manage to inject the array comparator into the JWT matcher, so it can use the same matching as regular objects? That way we would be able to recursively match JWTs, and use the regular expression matching to parts of the payload as well.

Zwartpet commented 7 years ago

Thats how I wanted to implement it at first, but I thought you had a reason not to inject the comparater. But yea assumptions are deadly, will update the code later today.

Zwartpet commented 6 years ago

Bump

christeredvartsen commented 6 years ago

Will have a look in a couple of days, slightly busy at the moment.

christeredvartsen commented 6 years ago

I think this PR is ready to be merged. Could you have a glance and give :+1: or :-1: @Zwartpet?