Skip to content

Commit

Permalink
fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Jan 2, 2024
1 parent 7971043 commit 5d7df0e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This file contains a complete enumeration of all [pull requests](https://github.
for a given releases. Unreleased, upcoming changes will be updated here periodically; reference the next release on our
[milestones](https://github.com/liip/LiipImagineBundle/milestones) page for the latest changes.

# 2.x

## [2.12.1](https://github.com/liip/LiipImagineBundle/tree/2.12.1)

- Adjustments to install with Symfony 7 ([mbabker](https://github.com/liip/LiipImagineBundle/pull/1535))
Expand Down
2 changes: 1 addition & 1 deletion Imagine/Filter/Loader/PasteFilterLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct(ImagineInterface $imagine, $projectDir)
}

/**
* @see \Liip\ImagineBundle\Imagine\Filter\Loader\LoaderInterface::load()
* @see LoaderInterface::load
*
* @return ImageInterface|static
*/
Expand Down
2 changes: 1 addition & 1 deletion Imagine/Filter/Loader/WatermarkFilterLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct(ImagineInterface $imagine, $projectDir)
}

/**
* @see \Liip\ImagineBundle\Imagine\Filter\Loader\LoaderInterface::load()
* @see LoaderInterface::load
*
* @return ImageInterface|static
*/
Expand Down
18 changes: 10 additions & 8 deletions Tests/Functional/Controller/ImagineControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
use Liip\ImagineBundle\Imagine\Cache\Signer;
use Liip\ImagineBundle\Tests\Functional\AbstractSetupWebTestCase;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

/**
* @covers \Liip\ImagineBundle\Controller\ImagineController
Expand All @@ -37,7 +39,7 @@ protected function setUp(): void
// supported by the current PHP build or not. Enabling WebP in configurations will drop all tests if WebP is
// not supported.
if ($this->webp_generate) {
$filterService = self::getService('test.liip_imagine.service.filter');
$filterService = $this->getService('test.liip_imagine.service.filter');
$webpGenerate = new \ReflectionProperty($filterService, 'webpGenerate');
$webpGenerate->setAccessible(true);
$webpGenerate->setValue($filterService, true);
Expand Down Expand Up @@ -162,7 +164,7 @@ public function testShouldResolveWebPFromCache(): void

public function testThrowBadRequestIfSignInvalidWhileUsingCustomFilters(): void
{
$this->expectException(\Symfony\Component\HttpKernel\Exception\BadRequestHttpException::class);
$this->expectException(BadRequestHttpException::class);
$this->expectExceptionMessage('Signed url does not pass the sign check for path "images/cats.jpeg" and filter "thumbnail_web_path" and runtime config {"thumbnail":{"size":["50","50"]}}');

$this->client->request('GET', '/media/cache/resolve/thumbnail_web_path/rc/invalidHash/images/cats.jpeg?'.http_build_query([
Expand All @@ -175,7 +177,7 @@ public function testThrowBadRequestIfSignInvalidWhileUsingCustomFilters(): void

public function testShouldThrowNotFoundHttpExceptionIfFiltersNotArray(): void
{
$this->expectException(\Symfony\Component\HttpKernel\Exception\NotFoundHttpException::class);
$this->expectException(NotFoundHttpException::class);
$this->expectExceptionMessage('Filters must be an array. Value was "some-string"');

$this->client->request('GET', '/media/cache/resolve/thumbnail_web_path/rc/invalidHash/images/cats.jpeg?'.http_build_query([
Expand All @@ -186,23 +188,23 @@ public function testShouldThrowNotFoundHttpExceptionIfFiltersNotArray(): void

public function testShouldThrowNotFoundHttpExceptionIfFileNotExists(): void
{
$this->expectException(\Symfony\Component\HttpKernel\Exception\NotFoundHttpException::class);
$this->expectException(NotFoundHttpException::class);
$this->expectExceptionMessage('Source image for path "images/shrodinger_cats_which_not_exist.jpeg" could not be found');

$this->client->request('GET', '/media/cache/resolve/thumbnail_web_path/images/shrodinger_cats_which_not_exist.jpeg');
}

public function testInvalidFilterShouldThrowNotFoundHttpException(): void
{
$this->expectException(\Symfony\Component\HttpKernel\Exception\NotFoundHttpException::class);
$this->expectException(NotFoundHttpException::class);

$this->client->request('GET', '/media/cache/resolve/invalid-filter/images/cats.jpeg');
}

public function testShouldResolveWithCustomFiltersPopulatingCacheFirst(): void
{
/** @var Signer $signer */
$signer = self::getService('liip_imagine.cache.signer');
$signer = $this->getService('liip_imagine.cache.signer');

$params = [
'filters' => [
Expand Down Expand Up @@ -240,7 +242,7 @@ public function testShouldResolveWithCustomFiltersPopulatingCacheFirst(): void
public function testShouldResolveWithCustomFiltersPopulatingCacheFirstWebP(): void
{
/** @var Signer $signer */
$signer = self::getService('liip_imagine.cache.signer');
$signer = $this->getService('liip_imagine.cache.signer');

$params = [
'filters' => [
Expand Down Expand Up @@ -283,7 +285,7 @@ public function testShouldResolveWithCustomFiltersPopulatingCacheFirstWebP(): vo
public function testShouldResolveWithCustomFiltersFromCache(): void
{
/** @var Signer $signer */
$signer = self::getService('liip_imagine.cache.signer');
$signer = $this->getService('liip_imagine.cache.signer');

$params = [
'filters' => [
Expand Down

0 comments on commit 5d7df0e

Please sign in to comment.