FriendlyContexts
FriendlyContexts copied to clipboard
Add fix for theResponseShouldContainsHeaders
Implemented proposed solution by @victuxbb in #118. I would also like to add specs but since the entire ApiContext is lacking specs and the theResponseShouldContainsHeaders method doesn't work at all at the moment I propose to merge the solution provided by @victuxbb in #118 and worry about specs later.
Hey @PedroTroller what about this one ? Really would like to see it merged and tagged ;) And BTW cheers to all the KNP Team!
I don't think it's a good idea to modify this step definition. You should create a new step named the headers should equal to.
This PR modifies the assertion from shlouldContain to shouldEqual, which I think is a bad idea.
@docteurklein sure but the default definition just do not work at all (since when can't tell)... so better to make it work even with a different assertion no?
Error is:
Type error: Argument 2 passed to Knp\FriendlyContexts\Utils\Asserter::assertArrayContains() must be of the type array, object given, called in vendor/knplabs/friendly-contexts/src/Knp/FriendlyContexts/Context/ApiContext.php on line 214 (Behat\Testwork\Call\Exception\FatalThrowableError)
I would preferably fix the existing definition AND create another one for another assertion.