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

Update comments #3

Merged
merged 2 commits into from
May 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Ratchet/Server/IoServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function handleConnect($conn) {
/**
* Data has been received from React
* @param string $data
* @param \React\Socket\ConnectionInterface $conn
* @param \Ratchet\ConnectionInterface $io_conn
*/
public function handleData($data, $io_conn) {
try {
Expand All @@ -151,7 +151,7 @@ public function handleData($data, $io_conn) {

/**
* A connection has been closed by React
* @param \React\Socket\ConnectionInterface $conn
* @param \Ratchet\ConnectionInterface $io_conn
*/
public function handleEnd($io_conn) {
try {
Expand All @@ -166,7 +166,7 @@ public function handleEnd($io_conn) {
/**
* An error has occurred, let the listening application know
* @param \Exception $e
* @param \React\Socket\ConnectionInterface $conn
* @param \Ratchet\ConnectionInterface $io_conn
*/
public function handleError(\Exception $e, $io_conn) {
$this->app->onError($io_conn, $e);
Expand Down
5 changes: 2 additions & 3 deletions tests/unit/Server/IoServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,10 @@ public function testNoLoopProvidedError() {
}

public function testOnErrorPassesException() {
$conn = $this->getMock('\\React\\Socket\\ConnectionInterface');
$conn->decor = $this->getMock('\\Ratchet\\ConnectionInterface');
$conn = $this->getMock('\\Ratchet\\ConnectionInterface');
$err = new \Exception("Nope");

$this->app->expects($this->once())->method('onError')->with($conn->decor, $err);
$this->app->expects($this->once())->method('onError')->with($conn, $err);

$this->server->handleError($err, $conn);
}
Expand Down