Completed
Push — master ( 3a8746...647efd )
by Jeroen
15:58 queued 10:12
created

ImageHandlerTest::testPrepareWithSvg()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Kunstmaan\MediaBundle\Tests\Helper\Image;
4
5
use Kunstmaan\MediaBundle\Entity\Media;
6
use Kunstmaan\MediaBundle\Helper\ExtensionGuesserFactory;
7
use Kunstmaan\MediaBundle\Helper\Image\ImageHandler;
8
use Kunstmaan\MediaBundle\Helper\MimeTypeGuesserFactory;
9
use Kunstmaan\UtilitiesBundle\Helper\Slugifier;
10
use PHPUnit\Framework\TestCase;
11
use Symfony\Component\HttpFoundation\File\File;
12
13
class ImageHandlerTest extends TestCase
14
{
15
    public function testPrepareWithSvg()
16
    {
17
        $media = new Media();
18
        $media->setContent(new File(__DIR__.'/../../Fixtures/sample.svg'));
19
20
        $handler = new ImageHandler(1, new MimeTypeGuesserFactory(), new ExtensionGuesserFactory(), 'aviaryKey');
21
        $handler->setSlugifier(new Slugifier());
22
23
        $handler->prepareMedia($media);
24
25
        $this->assertSame(['original_width' => null, 'original_height' => null], $media->getMetadata());
26
    }
27
}
28