phpmyadmin/test/classes/MimeTest.php
Gabriel Caruso 45828153b6 Use PSR-1 for PHPUnit TestCase
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2017-11-06 06:29:04 -02:00

65 lines
1.2 KiB
PHP

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* tests for PhpMyAdmin\Mime
*
* @package PhpMyAdmin-test
*/
namespace PhpMyAdmin\Tests;
use PhpMyAdmin\Mime;
use PHPUnit\Framework\TestCase;
/**
* Test for mime detection.
*
* @package PhpMyAdmin-test
*/
class MimeTest extends TestCase
{
/**
* Test for Mime::detect
*
* @param string $test MIME to test
* @param string $output Expected output
*
* @return void
* @dataProvider providerForTestDetect
*/
public function testDetect($test, $output)
{
$this->assertEquals(
Mime::detect($test),
$output
);
}
/**
* Provider for testDetect
*
* @return array data for testDetect
*/
public function providerForTestDetect()
{
return array(
array(
'pma',
'application/octet-stream'
),
array(
'GIF',
'image/gif'
),
array(
"\x89PNG",
'image/png'
),
array(
chr(0xff) . chr(0xd8),
'image/jpeg'
),
);
}
}