FriendlyContexts icon indicating copy to clipboard operation
FriendlyContexts copied to clipboard

Add fix for theResponseShouldContainsHeaders

Open krizon opened this issue 10 years ago • 5 comments

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.

krizon avatar Mar 24 '15 22:03 krizon

Hey @PedroTroller what about this one ? Really would like to see it merged and tagged ;) And BTW cheers to all the KNP Team!

wysow avatar Aug 11 '16 13:08 wysow

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 avatar Aug 12 '16 07:08 docteurklein

@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?

wysow avatar Aug 12 '16 07:08 wysow

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)

wysow avatar Aug 12 '16 07:08 wysow

I would preferably fix the existing definition AND create another one for another assertion.

docteurklein avatar Aug 12 '16 08:08 docteurklein