public static function mimeType($path) { $fileInfo = new finfo(FILEINFO_MIME_TYPE); return $fileInfo->file($path); }
/** * @test */ public function shouldReturnMimeType() { //given $path = Path::join(ROOT_PATH, 'test', 'resources', 'logo.png'); //when $mimeType = Files::mimeType($path); //then $this->assertEquals('image/png', $mimeType); }