/** * @param ClaimCheck $claimCheck * @return string * @throws ExceptionInterface */ private function fetchClaimCheckFromS3(ClaimCheck $claimCheck) { $s3Client = $this->configuration->getS3Client(); $result = $s3Client->getObject(['Bucket' => $claimCheck->getS3BucketName(), 'Key' => $claimCheck->getS3Key()]); $body = $result->get('Body'); // Unpack the message. if ($body instanceof StreamInterface) { try { return $body->getContents(); } catch (\RuntimeException $e) { throw new RuntimeException($e->getMessage(), 0, $e); } } return $body; }
public function testDeleteFromS3() { self::assertTrue($this->sut->getDeleteFromS3()); $this->sut->setDeleteFromS3(false); self::assertFalse($this->sut->getDeleteFromS3()); }