MimeTypeIconTest.php 1.13 KB
Newer Older
Guillaume Perréal's avatar
Guillaume Perréal committed
1
<?php declare(strict_types=1);
Guillaume Perréal's avatar
CS.    
Guillaume Perréal committed
2
/*
3
 * Copyright (C) 2015-2018 IRSTEA
Guillaume Perréal's avatar
CS.    
Guillaume Perréal committed
4
5
 * All rights reserved.
 */
6
7
8
9

namespace Irstea\FileUploadBundle\Tests\Utils;

use Irstea\FileUploadBundle\Utils\MimeTypeIcon;
10
use PHPUnit\Framework\TestCase;
11
12

/**
13
 * Class MimeTypeIconTest.
14
 */
15
class MimeTypeIconTest extends TestCase
16
17
{
    /**
Guillaume Perréal's avatar
CS.    
Guillaume Perréal committed
18
     * @covers       \Irstea\FileUploadBundle\Utils\MimeTypeIcon::getMimeTypeIcon
19
     * @dataProvider getTestValues
Guillaume Perréal's avatar
CS.    
Guillaume Perréal committed
20
21
22
     *
     * @param mixed $expected
     * @param mixed $input
23
24
25
     */
    public function testGetMimeTypeIcon($expected, $input)
    {
26
        static::assertEquals($expected, MimeTypeIcon::getMimeTypeIcon($input));
27
28
    }

29
30
31
    /**
     * @return array
     */
32
33
34
35
36
37
38
39
40
    public function getTestValues()
    {
        return [
            [null, ''],
            [null, []],
            ['audio', 'audio/mpeg'],
            ['text', 'text/plain'],
            ['video', 'video/mpeg'],
            ['image', 'image/png'],
Raidelet Nicolas's avatar
CS    
Raidelet Nicolas committed
41
            ['pdf', 'application/pdf'],
42
43
44
45
46
47
            ['archive', 'application/zip'],
            ['text', 'text/plain; charset=UTF-8'],
            ['archive', 'application/zip; format=lzh'],
        ];
    }
}