Exemplo n.º 1
0
 public function testGetExtensionByMime()
 {
     $this->assertEquals('html', Utils::getExtensionByMime('*/*'));
     $this->assertEquals('html', Utils::getExtensionByMime('text/*'));
     $this->assertEquals('html', Utils::getExtensionByMime('text/html'));
     $this->assertEquals('json', Utils::getExtensionByMime('application/json'));
     $this->assertEquals('atom', Utils::getExtensionByMime('application/atom+xml'));
     $this->assertEquals('rss', Utils::getExtensionByMime('application/rss+xml'));
     $this->assertEquals('jpg', Utils::getExtensionByMime('image/jpeg'));
     $this->assertEquals('png', Utils::getExtensionByMime('image/png'));
     $this->assertEquals('txt', Utils::getExtensionByMime('text/plain'));
     $this->assertEquals('doc', Utils::getExtensionByMime('application/msword'));
     $this->assertEquals('html', Utils::getExtensionByMime('foo/bar'));
     $this->assertEquals('baz', Utils::getExtensionByMime('foo/bar', 'baz'));
 }