Total Complexity | 7 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class MimeTest extends TestCase |
||
8 | { |
||
9 | |||
10 | public function test_when_mime_is_not_found_it_should_return_empty_value() |
||
11 | { |
||
12 | $this->assertSame('', Mime::type('fubar-type')); |
||
13 | } |
||
14 | |||
15 | public function test_return_first_known_mime_type() |
||
16 | { |
||
17 | $this->assertSame('application/x-httpd-php', Mime::type('php')); |
||
18 | } |
||
19 | |||
20 | public function test_return_known_mime_type_by_index() |
||
21 | { |
||
22 | $this->assertSame('text/csv', Mime::type('csv', 3)); |
||
23 | } |
||
24 | |||
25 | public function test_mime_list() |
||
26 | { |
||
27 | $this->assertSame( |
||
28 | ['application/x-zip', 'application/zip', 'application/x-zip-compressed'], |
||
29 | Mime::types('zip') |
||
30 | ); |
||
31 | } |
||
32 | |||
33 | public function test_unknown_mime_list() |
||
34 | { |
||
35 | $this->assertSame([], Mime::types('junk-extension-name')); |
||
36 | } |
||
37 | |||
38 | public function test_supports() |
||
39 | { |
||
40 | $this->assertTrue(Mime::supports('application/x-msg')); |
||
41 | $this->assertFalse(Mime::supports('fubar')); |
||
42 | } |
||
43 | |||
44 | public function test_extensions() |
||
45 | { |
||
46 | $this->assertEquals(['json'], Mime::extensions('application/json')); |
||
47 | } |
||
49 |