<?php

namespace Test\Michel\FileSystem;

use Michel\FileSystem\Mime\MimeType;
use Michel\UniTester\TestCase;

class MimeTypeTest extends TestCase
{
    protected function setUp(): void
    {
        // TODO: Implement setUp() method.
    }

    protected function tearDown(): void
    {
        // TODO: Implement tearDown() method.
    }

    protected function execute(): void
    {
        $this->testGetMimeTypeByExtension();
        $this->testGetExtensionByMimeType();
    }

    public function testGetMimeTypeByExtension()
    {
        // Test when extension exists
        $this->assertEquals('text/x-php', MimeType::getMimeTypeByExtension('php'));

        $this->assertNull(MimeType::getMimeTypeByExtension('unknown_extension'));
    }

    public function testGetExtensionByMimeType()
    {
        $this->assertEquals('php', MimeType::getExtensionByMimeType('text/x-php'));

        $this->assertNull(MimeType::getExtensionByMimeType('unknown_mime_type'));
    }

}
