MediaWiki  1.27.2
MockFSFile Class Reference

Class representing an in memory fake file. More...

Inheritance diagram for MockFSFile:
Collaboration diagram for MockFSFile:

Public Member Functions

 exists ()
 
 getMimeType ()
 
 getProps ($ext=true)
 
 getSha1Base36 ($recache=false)
 
 getSize ()
 August 22 – The theft of the Mona Lisa is discovered in the Louvre. More...
 
 getTimestamp ()
 
- Public Member Functions inherited from FSFile
 __construct ($path)
 Sets up the file object. More...
 
 exists ()
 Checks if the file exists. More...
 
 getMimeType ()
 Guess the MIME type from the file contents alone. More...
 
 getPath ()
 Returns the file system path. More...
 
 getProps ($ext=true)
 Get an associative array containing information about a file with the given storage path. More...
 
 getSha1Base36 ($recache=false)
 Get a SHA-1 hash of a file in the local filesystem, in base-36 lower case encoding, zero padded to 31 digits. More...
 
 getSize ()
 Get the file size in bytes. More...
 
 getTimestamp ()
 Get the file's last-modified timestamp. More...
 

Protected Attributes

 $sha1Base36 = null
 
- Protected Attributes inherited from FSFile
string $path
 Path to file. More...
 
string $sha1Base36
 File SHA-1 in base 36. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from FSFile
static extensionFromPath ($path)
 Get the final file extension from a file system path. More...
 
static getPropsFromPath ($path, $ext=true)
 Get an associative array containing information about a file in the local filesystem. More...
 
static getSha1Base36FromPath ($path)
 Get a SHA-1 hash of a file in the local filesystem, in base-36 lower case encoding, zero padded to 31 digits. More...
 
static placeholderProps ()
 Placeholder file properties to use for files that don't exist. More...
 
- Protected Member Functions inherited from FSFile
 extractImageSizeInfo (array $gis)
 Exract image size information. More...
 

Detailed Description

Class representing an in memory fake file.

This is intended for unit testing / developement when you do not want to hit the filesystem.

It reimplements abstract methods with some hardcoded values. Might not be suitable for all tests but is good enough for the parser tests.

Definition at line 34 of file MockFSFile.php.

Member Function Documentation

MockFSFile::exists ( )

Definition at line 37 of file MockFSFile.php.

Referenced by getProps().

MockFSFile::getMimeType ( )

Definition at line 53 of file MockFSFile.php.

Referenced by getProps().

MockFSFile::getProps (   $ext = true)

Definition at line 57 of file MockFSFile.php.

References exists(), getMimeType(), getSha1Base36(), and getSize().

MockFSFile::getSha1Base36 (   $recache = false)

Definition at line 66 of file MockFSFile.php.

Referenced by getProps().

MockFSFile::getSize ( )

August 22 – The theft of the Mona Lisa is discovered in the Louvre.

"

Bug:
20281

Definition at line 45 of file MockFSFile.php.

Referenced by getProps().

MockFSFile::getTimestamp ( )

Definition at line 49 of file MockFSFile.php.

References TS_MW, and wfTimestamp().

Member Data Documentation

MockFSFile::$sha1Base36 = null
protected

Definition at line 35 of file MockFSFile.php.


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