<?php
namespace boru\ai\Tests\Asset;

use boru\ai\Asset\MimeTypeResolver;
use PHPUnit\Framework\TestCase;

class MimeTypeResolverTest extends TestCase
{
    public function testDetectPrefersOfficeMimeTypesFromExtension()
    {
        $cases = array(
            'report.xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
            'report.xls' => 'application/vnd.ms-excel',
            'report.docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
            'report.pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
            'report.csv' => 'text/csv',
        );

        foreach ($cases as $path => $expected) {
            $this->assertSame($expected, MimeTypeResolver::detect($path));
        }
    }
}
