-
-
Notifications
You must be signed in to change notification settings - Fork 165
Remove unneeded stubs from tests #100
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
Conversation
tests/ServerTest.php
Outdated
->withConsecutive( | ||
array($this->equalTo("HTTP/1.1 200 OK\r\nX-Powered-By: React/alpha\r\nTransfer-Encoding: chunked\r\n\r\n")), | ||
array($this->equalTo("0\r\n\r\n")) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but doesn't match with the test title anymore?
tests/ServerTest.php
Outdated
public function testRequestEventIsEmitted() | ||
{ | ||
$io = new ServerStub(); | ||
$socket = new Socket($this->loop); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using a mock here? (refs #93)
See also below.
Updated. Checkout the newest commits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pesonally, I'd have preferred factory methods for creating the mocks, but i'm good with either.
The stubs aren't needed in the tests and can be replaced by a simple Connection mock.
This will make it easier to create tests for an upcoming PSR-7 PR.