MediaWiki  1.30.0
MimeMagicTest Class Reference
Inheritance diagram for MimeMagicTest:
Collaboration diagram for MimeMagicTest:

Public Member Functions

 doGuessMimeType (array $parameters=[])
 
 providerImproveTypeFromExtension ()
 
 setUp ()
 
 testImproveTypeFromExtension ( $ext, $oldMime, $expectedMime)
 providerImproveTypeFromExtension More...
 
 testMP3AsAudio ()
 Test to make sure that mp3 files are detected as audio type. More...
 
 testMP3NoID3RecognizeMPEG1 ()
 Test to make sure that MP3 without id3 tag is recognized (MPEG-1 sample rates) More...
 
 testMP3NoID3RecognizeMPEG2 ()
 Test to make sure that MP3 without id3 tag is recognized (MPEG-2 sample rates) More...
 
 testMP3NoID3RecognizeMPEG2_5 ()
 Test to make sure that MP3 without id3 tag is recognized (MPEG-2.5 sample rates) More...
 
 testMP3WithID3Recognize ()
 Test to make sure that MP3 with id3 tag is recognized. More...
 
 testOggRecognize ()
 Test to make sure that encoder=ffmpeg2theora doesn't trigger MEDIATYPE_VIDEO (T65584) More...
 
 testOpusRecognize ()
 Test to make sure that Opus audio files don't trigger MEDIATYPE_MULTIMEDIA (bug T151352) More...
 

Private Attributes

MimeAnalyzer $mimeAnalyzer
 

Detailed Description

Definition at line 6 of file MimeAnalyzerTest.php.

Member Function Documentation

◆ doGuessMimeType()

MimeMagicTest::doGuessMimeType ( array  $parameters = [])

◆ providerImproveTypeFromExtension()

MimeMagicTest::providerImproveTypeFromExtension ( )

Definition at line 45 of file MimeAnalyzerTest.php.

◆ setUp()

MimeMagicTest::setUp ( )

Definition at line 10 of file MimeAnalyzerTest.php.

References $IP, and global.

◆ testImproveTypeFromExtension()

MimeMagicTest::testImproveTypeFromExtension (   $ext,
  $oldMime,
  $expectedMime 
)

providerImproveTypeFromExtension

Parameters
string$extFile extension (no leading dot)
string$oldMimeInitially detected MIME
string$expectedMimeMIME type after taking extension into account

Definition at line 40 of file MimeAnalyzerTest.php.

References $ext.

◆ testMP3AsAudio()

MimeMagicTest::testMP3AsAudio ( )

Test to make sure that mp3 files are detected as audio type.

Definition at line 87 of file MimeAnalyzerTest.php.

References MEDIATYPE_AUDIO.

◆ testMP3NoID3RecognizeMPEG1()

MimeMagicTest::testMP3NoID3RecognizeMPEG1 ( )

Test to make sure that MP3 without id3 tag is recognized (MPEG-1 sample rates)

Definition at line 105 of file MimeAnalyzerTest.php.

References doGuessMimeType().

◆ testMP3NoID3RecognizeMPEG2()

MimeMagicTest::testMP3NoID3RecognizeMPEG2 ( )

Test to make sure that MP3 without id3 tag is recognized (MPEG-2 sample rates)

Definition at line 114 of file MimeAnalyzerTest.php.

References doGuessMimeType().

◆ testMP3NoID3RecognizeMPEG2_5()

MimeMagicTest::testMP3NoID3RecognizeMPEG2_5 ( )

Test to make sure that MP3 without id3 tag is recognized (MPEG-2.5 sample rates)

Definition at line 123 of file MimeAnalyzerTest.php.

References doGuessMimeType().

◆ testMP3WithID3Recognize()

MimeMagicTest::testMP3WithID3Recognize ( )

Test to make sure that MP3 with id3 tag is recognized.

Definition at line 96 of file MimeAnalyzerTest.php.

References doGuessMimeType().

◆ testOggRecognize()

MimeMagicTest::testOggRecognize ( )

Test to make sure that encoder=ffmpeg2theora doesn't trigger MEDIATYPE_VIDEO (T65584)

Definition at line 68 of file MimeAnalyzerTest.php.

References MEDIATYPE_AUDIO.

◆ testOpusRecognize()

MimeMagicTest::testOpusRecognize ( )

Test to make sure that Opus audio files don't trigger MEDIATYPE_MULTIMEDIA (bug T151352)

Definition at line 78 of file MimeAnalyzerTest.php.

References MEDIATYPE_AUDIO.

Member Data Documentation

◆ $mimeAnalyzer

MimeAnalyzer MimeMagicTest::$mimeAnalyzer
private

Definition at line 8 of file MimeAnalyzerTest.php.


The documentation for this class was generated from the following file: