-
-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 5.5: [MediaBundle] Fix php 7.4 incompatibility [GeneratorBundle] Fix doctrine fixtures error during install command
- Loading branch information
Showing
4 changed files
with
54 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions
27
src/Kunstmaan/MediaBundle/Tests/unit/Helper/Image/ImageHandlerTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace Kunstmaan\MediaBundle\Tests\Helper\Image; | ||
|
||
use Kunstmaan\MediaBundle\Entity\Media; | ||
use Kunstmaan\MediaBundle\Helper\ExtensionGuesserFactory; | ||
use Kunstmaan\MediaBundle\Helper\Image\ImageHandler; | ||
use Kunstmaan\MediaBundle\Helper\MimeTypeGuesserFactory; | ||
use Kunstmaan\UtilitiesBundle\Helper\Slugifier; | ||
use PHPUnit\Framework\TestCase; | ||
use Symfony\Component\HttpFoundation\File\File; | ||
|
||
class ImageHandlerTest extends TestCase | ||
{ | ||
public function testPrepareWithSvg() | ||
{ | ||
$media = new Media(); | ||
$media->setContent(new File(__DIR__.'/../../Fixtures/sample.svg')); | ||
|
||
$handler = new ImageHandler(1, new MimeTypeGuesserFactory(), new ExtensionGuesserFactory(), 'aviaryKey'); | ||
$handler->setSlugifier(new Slugifier()); | ||
|
||
$handler->prepareMedia($media); | ||
|
||
$this->assertSame(['original_width' => null, 'original_height' => null], $media->getMetadata()); | ||
} | ||
} |