1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32:
<?php
namespace Guzzle\Tests\Http;
use Guzzle\Http\Mimetypes;
class MimetypesTest extends \Guzzle\Tests\GuzzleTestCase
{
public function testGetsFromExtension()
{
$this->assertEquals('text/x-php', Mimetypes::getInstance()->fromExtension('php'));
}
public function testGetsFromFilename()
{
$this->assertEquals('text/x-php', Mimetypes::getInstance()->fromFilename(__FILE__));
}
public function testGetsFromCaseInsensitiveFilename()
{
$this->assertEquals('text/x-php', Mimetypes::getInstance()->fromFilename(strtoupper(__FILE__)));
}
public function testReturnsNullWhenNoMatchFound()
{
$this->assertNull(Mimetypes::getInstance()->fromExtension('foobar'));
}
}