test: cover errored empty Mongo receives

This commit is contained in:
Jake Barnby committed 2026-07-18 13:34:40 +12:00
1 parent b6021cb599
commit 1b3604d899
1 file changed
+15
+15
View File
@@ -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();