MediaWiki REL1_33
MimeAnalyzerTest Class Reference

Media MimeAnalyzer. More...

Inheritance diagram for MimeAnalyzerTest:
Collaboration diagram for MimeAnalyzerTest:

Public Member Functions

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

Private Attributes

MimeAnalyzer $mimeAnalyzer
 

Detailed Description

Media MimeAnalyzer.

Definition at line 6 of file MimeAnalyzerTest.php.

Member Function Documentation

◆ doGuessMimeType()

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

◆ providerImproveTypeFromExtension()

MimeAnalyzerTest::providerImproveTypeFromExtension ( )

Definition at line 48 of file MimeAnalyzerTest.php.

◆ setUp()

MimeAnalyzerTest::setUp ( )

Definition at line 13 of file MimeAnalyzerTest.php.

References $IP.

◆ testImproveTypeFromExtension()

MimeAnalyzerTest::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 43 of file MimeAnalyzerTest.php.

References $ext.

◆ testMP3AsAudio()

MimeAnalyzerTest::testMP3AsAudio ( )

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

Definition at line 90 of file MimeAnalyzerTest.php.

References $file, and MEDIATYPE_AUDIO.

◆ testMP3NoID3RecognizeMPEG1()

MimeAnalyzerTest::testMP3NoID3RecognizeMPEG1 ( )

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

Definition at line 108 of file MimeAnalyzerTest.php.

References $file, and doGuessMimeType().

◆ testMP3NoID3RecognizeMPEG2()

MimeAnalyzerTest::testMP3NoID3RecognizeMPEG2 ( )

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

Definition at line 117 of file MimeAnalyzerTest.php.

References $file, and doGuessMimeType().

◆ testMP3NoID3RecognizeMPEG2_5()

MimeAnalyzerTest::testMP3NoID3RecognizeMPEG2_5 ( )

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

Definition at line 126 of file MimeAnalyzerTest.php.

References $file, and doGuessMimeType().

◆ testMP3WithID3Recognize()

MimeAnalyzerTest::testMP3WithID3Recognize ( )

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

Definition at line 99 of file MimeAnalyzerTest.php.

References $file, and doGuessMimeType().

◆ testOggRecognize()

MimeAnalyzerTest::testOggRecognize ( )

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

Definition at line 71 of file MimeAnalyzerTest.php.

References MEDIATYPE_AUDIO.

◆ testOpusRecognize()

MimeAnalyzerTest::testOpusRecognize ( )

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

Definition at line 81 of file MimeAnalyzerTest.php.

References MEDIATYPE_AUDIO.

◆ testZipInDoc()

MimeAnalyzerTest::testZipInDoc ( )

A ZIP file embedded in the middle of a .doc file is still a Word Document.

Definition at line 135 of file MimeAnalyzerTest.php.

References $file, and doGuessMimeType().

Member Data Documentation

◆ $mimeAnalyzer

MimeAnalyzer MimeAnalyzerTest::$mimeAnalyzer
private

Definition at line 11 of file MimeAnalyzerTest.php.


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