From 40867d734d1476422a9b93300bb353c0091a360f Mon Sep 17 00:00:00 2001 From: Maxim Smakouz Date: Thu, 27 Jun 2024 10:59:16 +0300 Subject: [PATCH] Simplify test --- tests/Goridge/RPCTest.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/Goridge/RPCTest.php b/tests/Goridge/RPCTest.php index 165a397..6468c58 100644 --- a/tests/Goridge/RPCTest.php +++ b/tests/Goridge/RPCTest.php @@ -7,7 +7,6 @@ use Exception; use PHPUnit\Framework\TestCase; use Spiral\Goridge\Frame; -use Spiral\Goridge\Relay; use Spiral\Goridge\RelayInterface; use Spiral\Goridge\RPC\Codec\RawCodec; use Spiral\Goridge\RPC\Exception\CodecException; @@ -157,7 +156,7 @@ public function testLongRawBody(): void { $conn = $this->makeRPC(); $payload = random_bytes(65000 * 1000); - + $resp = $conn->withCodec(new RawCodec())->call( 'Service.EchoBinary', $payload @@ -255,7 +254,7 @@ public function testJsonException(): void */ public function testCallSequence(): void { - $relay1 = $this->getMockBuilder(Relay::class)->onlyMethods(['waitFrame', 'send'])->getMock(); + $relay1 = $this->createMock(RelayInterface::class); $relay1 ->method('waitFrame') ->willReturnOnConsecutiveCalls( @@ -271,7 +270,7 @@ public function testCallSequence(): void [new Frame('Service.Process{"Name":"foo","Value":18}', [3, 15], 8)] ); - $relay2 = $this->getMockBuilder(Relay::class)->onlyMethods(['waitFrame', 'send'])->getMock(); + $relay2 = $this->createMock(RelayInterface::class); $relay2 ->method('waitFrame') ->willReturnOnConsecutiveCalls(