| Total Complexity | 2 |
| Total Lines | 18 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class GeneratedExtensionToMimeTypeMapTest extends TestCase |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @test |
||
| 14 | * @dataProvider expectedLookupResults |
||
| 15 | */ |
||
| 16 | public function looking_up_mimetypes(string $extension, ?string $expectedMimeType): void |
||
| 17 | { |
||
| 18 | $map = new GeneratedExtensionToMimeTypeMap(); |
||
| 19 | $actual = $map->lookupMimeType($extension); |
||
| 20 | $this->assertEquals($expectedMimeType, $actual); |
||
| 21 | } |
||
| 22 | |||
| 23 | public function expectedLookupResults(): Generator |
||
| 24 | { |
||
| 25 | yield ['jpg', 'image/jpeg']; |
||
| 26 | yield ['svg', 'image/svg+xml']; |
||
| 27 | yield ['lol', null]; |
||
| 28 | } |
||
| 30 |