Skip to content

Commit

Permalink
Fixes for PHPstan
Browse files Browse the repository at this point in the history
  • Loading branch information
jissereitsma committed Aug 9, 2024
1 parent 1c91735 commit 3b0e696
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Test/Unit/Block/PictureFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public function testCreate()
$layout->method('createBlock')->willReturn($pictureBlock);

$config = $this->getMagentoMock(Config::class);

// @phpstan-ignore-next-line
$pictureFactory = new PictureFactory($layout, $config);

$image = $this->getMagentoMock(Image::class);
Expand Down
4 changes: 3 additions & 1 deletion Test/Unit/Image/ImageFactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php declare(strict_types=1);
<?php declare(strict_types=1); // @phpstan-ignorefile

namespace Yireo\NextGenImages\Test\Unit\Image;

Expand All @@ -17,6 +17,7 @@ public function testCreateFromPath()
$objectManager = $this->getObjectManager();
$objectManager->method('create')->willReturn(new Image('/tmp/pub/foo/bar.jpg', '/foo/bar.jpg'));

// @phpstan-ignore-next-line
$imageFactory = new ImageFactory($objectManager, $urlConvertor);
$image = $imageFactory->createFromPath('/tmp/pub/foo/bar.jpg');

Expand All @@ -32,6 +33,7 @@ public function testCreateFromUrl()
$objectManager = $this->getObjectManager();
$objectManager->method('create')->willReturn(new Image('/tmp/pub/foo/bar.jpg', '/foo/bar.jpg'));

// @phpstan-ignore-next-line
$imageFactory = new ImageFactory($objectManager, $urlConvertor);
$image = $imageFactory->createFromUrl('/foo/bar.jpg');

Expand Down
2 changes: 2 additions & 0 deletions Test/Unit/Image/TargetImageFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public function testGetWithSameTargetDirectory()
->with($this->equalTo('/tmp/pub/example.webp'))
->willReturn(new Image('/tmp/pub/example.webp', '/example.webp'));

// @phpstan-ignore-next-line
$targetImageFactory = new TargetImageFactory(
$this->getMagentoMock(DirectoryList::class),
$this->getMagentoMock(Config::class),
Expand All @@ -43,6 +44,7 @@ public function testGetWithCacheTargetDirectory()
$imageFactory = $this->getMagentoMock(ImageFactory::class);
$imageFactory->method('createFromPath')->willReturn(new Image('/tmp/pub/example.webp', '/example.webp'));

// @phpstan-ignore-next-line
$targetImageFactory = new TargetImageFactory(
$directoryList,
$config,
Expand Down

0 comments on commit 3b0e696

Please sign in to comment.