mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
test: cover errored empty Mongo receives
This commit is contained in:
1 parent
b6021cb599
commit
1b3604d899
1 file changed
+15
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user