MimeTypeIconTest.php 1.13 KiB
<?php declare(strict_types=1);
/*
 * Copyright (C) 2015-2018 IRSTEA
 * All rights reserved.
 */
namespace Irstea\FileUploadBundle\Tests\Utils;
use Irstea\FileUploadBundle\Utils\MimeTypeIcon;
use PHPUnit\Framework\TestCase;
/**
 * Class MimeTypeIconTest.
class MimeTypeIconTest extends TestCase
    /**
     * @covers       \Irstea\FileUploadBundle\Utils\MimeTypeIcon::getMimeTypeIcon
     * @dataProvider getTestValues
     * @param mixed $expected
     * @param mixed $input
    public function testGetMimeTypeIcon($expected, $input)
        static::assertEquals($expected, MimeTypeIcon::getMimeTypeIcon($input));
    /**
     * @return array
    public function getTestValues()
        return [
            [null, ''],
            [null, []],
            ['audio', 'audio/mpeg'],
            ['text', 'text/plain'],
            ['video', 'video/mpeg'],
            ['image', 'image/png'],
            ['pdf', 'application/pdf'],
            ['archive', 'application/zip'],
            ['text', 'text/plain; charset=UTF-8'],
            ['archive', 'application/zip; format=lzh'],