From 1b3604d899c6cb670193c991308f1d1e9d1eadae Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sat, 18 Jul 2026 13:34:40 +1200 Subject: [PATCH] test: cover errored empty Mongo receives --- tests/ClientTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/ClientTest.php b/tests/ClientTest.php index eea3557157..0c5d162a2c 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -227,6 +227,21 @@ final class ClientTest extends TestCase $this->assertSame([], $transport->closes); } + public function testErroredEmptyReceiveHardClosesTransport(): void + { + $transport = new SyncTransportDouble(); + $transport->receives = [['result' => '', 'error' => 11]]; + $client = $this->client($transport); + $this->seedState($client); + + $exception = $this->receiveException($client); + + $this->assertSame(11601, $exception->getCode()); + $this->assertStringContainsString('errCode=11', $exception->getMessage()); + $this->assertSame([[true]], $transport->closes); + $this->assertStateCleared($client); + } + public function testReceiveDeadlineHardClosesTransport(): void { $transport = new SyncTransportDouble();