getWrapped(); $command = new Command('GetItem'); $response = new Response(200, [], '{"foo": "bar"}'); $this->assertInstanceOf(ResultInterface::class, $wrapped($command, $response)); } public function testThrowsWhenMismatch() { $wrapped = $this->getWrapped(); $command = new Command('GetItem'); $response = new Response(200, ['x-amz-crc32' => '123'], '{"foo": "bar"}'); try { $wrapped($command, $response); $this->fail(); } catch (AwsException $e) { $this->assertStringContainsString('crc32 mismatch. Expected 123, found 11124959', $e->getMessage()); $this->assertTrue($e->isConnectionError()); } } public function testNothingWhenValidChecksum() { $wrapped = $this->getWrapped(); $command = new Command('GetItem'); $response = new Response(200, ['x-amz-crc32' => '11124959'], '{"foo": "bar"}'); $this->assertInstanceOf(ResultInterface::class, $wrapped($command, $response)); } }