MediaWiki  master
MediaWikiMediaTestCase Class Reference

Specificly for testing Media handlers. More...

Inheritance diagram for MediaWikiMediaTestCase:
Collaboration diagram for MediaWikiMediaTestCase:

Protected Member Functions

 createsThumbnails ()
 Will the test create thumbnails (and thus do we need to set aside a temporary directory for them?) More...
 
 dataFile ( $name, $type=false)
 Utility function: Get a new file object for a file on disk but not actually in db. More...
 
 getFilePath ()
 The result of this method will set the file path to use, as well as the protected member $filePath. More...
 
 getRepoOptions ()
 
 setUp ()
 

Protected Attributes

FSFileBackend $backend
 
string $filePath
 
FileRepo $repo
 

Detailed Description

Specificly for testing Media handlers.

Sets up a FileRepo backend

Definition at line 5 of file MediaWikiMediaTestCase.php.

Member Function Documentation

◆ createsThumbnails()

MediaWikiMediaTestCase::createsThumbnails ( )
protected

Will the test create thumbnails (and thus do we need to set aside a temporary directory for them?)

Override this method if your test case creates thumbnails

Returns
bool

Definition at line 64 of file MediaWikiMediaTestCase.php.

Referenced by setUp().

◆ dataFile()

MediaWikiMediaTestCase::dataFile (   $name,
  $type = false 
)
protected

Utility function: Get a new file object for a file on disk but not actually in db.

File must be in the path returned by getFilePath()

Parameters
string$nameFile name
string | false$typeMIME type [optional]
Returns
UnregisteredLocalFile

Definition at line 76 of file MediaWikiMediaTestCase.php.

References $type.

Referenced by ImagePageTest\getImagePage(), ImagePage404Test\getImagePage(), FileTest\testCanAnimateThumbIfAppropriate(), PNGHandlerTest\testGetImageArea(), GIFHandlerTest\testGetImageArea(), XCFHandlerTest\testGetImageSize(), SvgHandlerTest\testGetIndependentMetaArray(), JpegTest\testGetIndependentMetaArray(), GIFHandlerTest\testGetIndependentMetaArray(), PNGHandlerTest\testGetIndependentMetaArray(), PNGHandlerTest\testGetLength(), GIFHandlerTest\testGetLength(), XCFHandlerTest\testGetMetadata(), GIFHandlerTest\testGetMetadata(), PNGHandlerTest\testGetMetadata(), DjVuTest\testGetPageDimensions(), DjVuTest\testGetPageText(), FormatMetadataTest\testInvalidDate(), JpegTest\testInvalidFile(), PNGHandlerTest\testIsAnimanted(), GIFHandlerTest\testIsAnimanted(), JpegTest\testJpegMetadataExtraction(), ExifRotationTest\testMetadata(), ExifRotationTest\testMetadataAutoRotate(), ExifRotationTest\testMetadataAutoRotateUnsupported(), ExifRotationTest\testMetadataNoAutoRotate(), DjVuTest\testPageCount(), JpegPixelFormatTest\testPixelFormatRendering(), ExifRotationTest\testRotationRendering(), ExifRotationTest\testRotationRenderingNoAutoRotate(), and JpegTest\testSwappingICCProfile().

◆ getFilePath()

MediaWikiMediaTestCase::getFilePath ( )
protected

The result of this method will set the file path to use, as well as the protected member $filePath.

Returns
string Path where files are

Definition at line 52 of file MediaWikiMediaTestCase.php.

Referenced by setUp().

◆ getRepoOptions()

MediaWikiMediaTestCase::getRepoOptions ( )
protected
Returns
array Argument for FileRepo constructor

Definition at line 38 of file MediaWikiMediaTestCase.php.

References $backend.

Referenced by setUp().

◆ setUp()

MediaWikiMediaTestCase::setUp ( )
protected

Member Data Documentation

◆ $backend

FSFileBackend MediaWikiMediaTestCase::$backend
protected

Definition at line 10 of file MediaWikiMediaTestCase.php.

Referenced by getRepoOptions().

◆ $filePath

string MediaWikiMediaTestCase::$filePath
protected

Definition at line 12 of file MediaWikiMediaTestCase.php.

Referenced by setUp().

◆ $repo

FileRepo MediaWikiMediaTestCase::$repo
protected

Definition at line 8 of file MediaWikiMediaTestCase.php.


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