/** * Returns the mimetype of a version provided by this plugin via retrieving and inspecting. * More specific plugins should override this for performance. * * @param File $file * @param Version $version * @return string */ public function getMimeType(File $file, Version $version) { $retrieved = $this->storage->retrieveVersion($this->getApplicableVersionable($file), $version); $fileObj = new FileObject($retrieved); return $fileObj->getMimeType(); }
/** * @test */ public function returnsMimeType() { $fileObj = new FileObject(ROOT_TESTS . '/data/self-lussing-manatee.jpg'); $this->assertEquals('image/jpeg', $fileObj->getMimeType()); }
/** * Returns mime type * * @return string */ public function getMimeType() { return $this->fileObject->getMimeType(); }