/** * Return the mimetype of the file. * * @return string */ public function getMimetype() { return Mimetypes::getInstance()->fromFilename($this->path) ?: 'text/plain'; }
public function testReturnsNullWhenNoMatchFound() { $this->assertNull(Mimetypes::getInstance()->fromExtension('foobar')); }