Skip to content

Commit 0c8c939

Browse files
committed
Update for renames in amphp/websocket-server
1 parent f9562ae commit 0c8c939

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test/WebsocketConnectionTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
use Amp\TimeoutCancellation;
1515
use Amp\Websocket\Client;
1616
use Amp\Websocket\ClosedException;
17-
use Amp\Websocket\Server\ClientHandler;
18-
use Amp\Websocket\Server\EmptyHandshakeHandler;
17+
use Amp\Websocket\Server\EmptyWebsocketHandshakeHandler;
1918
use Amp\Websocket\Server\Websocket;
19+
use Amp\Websocket\Server\WebsocketClientHandler;
2020
use Amp\Websocket\WebsocketClient;
2121
use Psr\Log\NullLogger;
2222
use function Amp\async;
@@ -30,14 +30,14 @@ class WebsocketConnectionTest extends AsyncTestCase
3030
* @return array{HttpServer, SocketAddress} Returns the HttpServer instance and the used port number.
3131
* @throws SocketException
3232
*/
33-
protected function createServer(ClientHandler $clientHandler): array
33+
protected function createServer(WebsocketClientHandler $clientHandler): array
3434
{
3535
$logger = new NullLogger;
3636

3737
$httpServer = new SocketHttpServer($logger);
3838
$httpServer->expose(new InternetAddress('127.0.0.1', 0));
3939
$httpServer->start(
40-
new Websocket($logger, new EmptyHandshakeHandler(), $clientHandler),
40+
new Websocket($logger, new EmptyWebsocketHandshakeHandler(), $clientHandler),
4141
new DefaultErrorHandler(),
4242
);
4343

@@ -48,7 +48,7 @@ protected function createServer(ClientHandler $clientHandler): array
4848

4949
public function testSimpleBinaryEcho(): void
5050
{
51-
[$server, $address] = $this->createServer(new class implements ClientHandler {
51+
[$server, $address] = $this->createServer(new class implements WebsocketClientHandler {
5252
public function handleClient(WebsocketClient $client, Request $request, Response $response): void
5353
{
5454
while ($message = $client->receive()) {
@@ -77,7 +77,7 @@ public function handleClient(WebsocketClient $client, Request $request, Response
7777

7878
public function testSimpleTextEcho(): void
7979
{
80-
[$server, $address] = $this->createServer(new class implements ClientHandler {
80+
[$server, $address] = $this->createServer(new class implements WebsocketClientHandler {
8181
public function handleClient(WebsocketClient $client, Request $request, Response $response): void
8282
{
8383
while ($message = $client->receive()) {
@@ -106,7 +106,7 @@ public function handleClient(WebsocketClient $client, Request $request, Response
106106

107107
public function testUnconsumedMessage(): void
108108
{
109-
[$server, $address] = $this->createServer(new class implements ClientHandler {
109+
[$server, $address] = $this->createServer(new class implements WebsocketClientHandler {
110110
public function handleClient(WebsocketClient $client, Request $request, Response $response): void
111111
{
112112
$client->send(\str_repeat('.', 1024 * 1024));
@@ -140,7 +140,7 @@ public function handleClient(WebsocketClient $client, Request $request, Response
140140

141141
public function testVeryLongMessage(): void
142142
{
143-
[$server, $address] = $this->createServer(new class implements ClientHandler {
143+
[$server, $address] = $this->createServer(new class implements WebsocketClientHandler {
144144
public function handleClient(WebsocketClient $client, Request $request, Response $response): void
145145
{
146146
$payload = \str_repeat('.', 1024 * 1024 * 10); // 10 MiB
@@ -164,7 +164,7 @@ public function handleClient(WebsocketClient $client, Request $request, Response
164164

165165
public function testTooLongMessage(): void
166166
{
167-
[$server, $address] = $this->createServer(new class() implements ClientHandler {
167+
[$server, $address] = $this->createServer(new class implements WebsocketClientHandler {
168168
public function handleClient(WebsocketClient $client, Request $request, Response $response): void
169169
{
170170
$payload = \str_repeat('.', 1024 * 1024 * 10 + 1); // 10 MiB + 1 byte

0 commit comments

Comments
 (0)