Skip to content

Commit

Permalink
Merge pull request #1461 from liip/remove-guzzle-return-mock
Browse files Browse the repository at this point in the history
return values from the aws client are not used
  • Loading branch information
dbu authored Feb 11, 2022
2 parents a77cd62 + 78ba9b8 commit 1a04fac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 36 deletions.
19 changes: 0 additions & 19 deletions Tests/Fixtures/Model.php

This file was deleted.

21 changes: 4 additions & 17 deletions Tests/Imagine/Cache/Resolver/AwsS3ResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Liip\ImagineBundle\Tests\Imagine\Cache\Resolver;

use Aws\S3\S3Client;
use Guzzle\Service\Resource\Model;
use Liip\ImagineBundle\Imagine\Cache\Resolver\AwsS3Resolver;
use Liip\ImagineBundle\Imagine\Cache\Resolver\ResolverInterface;
use Liip\ImagineBundle\Model\Binary;
Expand Down Expand Up @@ -86,8 +85,7 @@ public function testCreateObjectOnAmazon(): void
$s3 = $this->getS3ClientMock();
$s3
->expects($this->once())
->method('putObject')
->willReturn($this->getS3ResponseMock());
->method('putObject');

$resolver = new AwsS3Resolver($s3, 'images.example.com');
$resolver->store($binary, 'thumb/foobar.jpg', 'thumb');
Expand Down Expand Up @@ -176,8 +174,7 @@ public function testRemoveCacheForPathAndFilterOnRemove(): void
->with([
'Bucket' => 'images.example.com',
'Key' => 'thumb/some-folder/path.jpg',
])
->willReturn($this->getS3ResponseMock());
]);

$resolver = new AwsS3Resolver($s3, 'images.example.com');
$resolver->remove(['some-folder/path.jpg'], ['thumb']);
Expand Down Expand Up @@ -205,8 +202,7 @@ public function testRemoveCacheForSomePathsAndFilterOnRemove(): void
'Bucket' => 'images.example.com',
'Key' => 'thumb/pathTwo.jpg',
]
)
->willReturn($this->getS3ResponseMock());
);

$resolver = new AwsS3Resolver($s3, 'images.example.com');
$resolver->remove(
Expand Down Expand Up @@ -247,8 +243,7 @@ public function testRemoveCacheForSomePathsAndSomeFiltersOnRemove(): void
'Bucket' => 'images.example.com',
'Key' => 'filterTwo/pathTwo.jpg',
]
)
->willReturn($this->getS3ResponseMock());
);

$resolver = new AwsS3Resolver($s3, 'images.example.com');
$resolver->remove(
Expand Down Expand Up @@ -348,14 +343,6 @@ public function testCatchAndLogExceptionForFilterOnRemove(): void
$resolver->remove([], [$expectedFilter]);
}

/**
* @return MockObject|Model
*/
protected function getS3ResponseMock()
{
return $this->createObjectMock(Model::class);
}

/**
* @return MockObject|\Aws\S3\S3Client
*/
Expand Down

0 comments on commit 1a04fac

Please sign in to comment.