nebkam / fluent-test

A few helpers to ease functional API testing in Symfony
10 stars 2 forks source link

Should the Response object be exposed in ResponseWrapper? #4

Closed lynnntropy closed 6 years ago

lynnntropy commented 6 years ago

It seems unnecessarily restrictive to me to completely prevent access to the underlying Response when using the ResponseWrapper. Response has a lot of useful methods that ResponseWrapper doesn't replicate; getting a Response that allows you to use methods such as isRedirect() and isSuccessful() basically requires bypassing the request builder completely, at which point you might as well use the client directly.

I think it would be good to add a getResponse() method to ResponseWrapper that allows access to the Response object when necessary.

nebkam commented 6 years ago

Totally makes sense. The point of the ResponseWrapper was enhancing Response, not encapsulation.

Added ResponseWrapper::getResponse in 2.0.2