Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge interesting parts of behat/rest-extension #3

Open
stof opened this issue May 8, 2014 · 4 comments
Open

Merge interesting parts of behat/rest-extension #3

stof opened this issue May 8, 2014 · 4 comments

Comments

@stof
Copy link
Member

stof commented May 8, 2014

@jakzal started https://github.com/jakzal/RestExtension for a similar purpose. The interesting parts of the extension should be merged here.

I'm thinking in particular to the response matcher, which is something I wanted to implement in WebApiExtension. The library used in the RestExtension seems to fit very well with what I have in mind.

@fesor
Copy link

fesor commented Sep 16, 2014

I think it will be better if this will be a separate packages. This gives more flexibility for developer, who will decide which library he wants to use to make requests (webapiextension or just custom steps with curl/guzzle) and check responses. You can use ApiClientAwareContext and provide to user similar interface to inject response. For example my json_spec provides JsonProviderInterface for this purposes.

@tyx
Copy link

tyx commented Sep 16, 2014

Since yesterday JsonContext from behatch-context is totally decoupled from its RestContext :
https://github.com/sanpii/behatch-contexts/blob/master/src/Context/JsonContext.php

So it become very simple to use it with WebApiContext. Here is a Poc I currently use :
tyx@58d832a

@fesor
Copy link

fesor commented Sep 28, 2014

@tyx, i guess simple wrapping and replacing GuzzleHttp\Client in container may do the trick. I prepared PR #16 to this purposes. I think it is a best solution as it doesn't involve library user at all, just add extension and context and you ready to go.

@yosmanyga
Copy link

This extension uses PHPUnit_Framework_Assert. I can't see how to use coduo/php-matcher? Do you have any plan?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants