Closed PeeHaa closed 6 years ago
@PeeHaa Why? By that definition that issue should be opened on amphp/http-server
, because it affects every RequestHandler
. You can simply create a Request
and Response
object instead of creating a mock.
Could be that it is needed in http server too. Hit the issue here in websocket.
The reason I want to use a mock is that mocks come with stuff like number of calls to a specific method and param passing assertion out of the box.
You're probably testing internals that shouldn't really be tested? I assume you're only really interested in the result of the code, not how it is actually produced?
Adding an interface for Request
/ Response
turns every addition into a BC break, while currently we could add methods at any time.
Having an interface doesn't prevent you from adding methods. It prevents you from adding methods to that specific interface.
And yes I am using it as a spy.
I'll close this issue. If a change is really to be made, it has to happen in amphp/http-server
.
The
Application
interface hints against final classes likeAmp\Http\Server\Request
andAmp\Http\Server\Response
making trying to run tests harder than need be.