MediaWiki  1.28.1
FileBackendTest Class Reference

FileRepo FileBackend medium. More...

Inheritance diagram for FileBackendTest:
Collaboration diagram for FileBackendTest:

Public Member Functions

 assertBackendPathsConsistent (array $paths)
 assertGoodStatus (StatusValue $status, $msg)
 doTestGetLocalCopyAndReference404 ()
 tearDownFiles ()
 testAsyncWrites ()
 testConcatenate ($op, $srcs, $srcsContent, $alreadyExists, $okStatus)
 provider_testConcatenate More...
 testCopy ($op)
 provider_testCopy FileBackend::doOperation More...
 testCreate ($op, $alreadyExists, $okStatus, $newSize)
 provider_testCreate FileBackend::doOperation More...
 testDelete ($op, $withSource, $okStatus)
 provider_testDelete FileBackend::doOperation More...
 testDescribe ($op, $withSource, $okStatus)
 provider_testDescribe FileBackend::doOperation More...
 testDoOperations ()
 FileBackend::doOperations. More...
 testDoOperationsFailing ()
 FileBackend::doOperations. More...
 testDoOperationsPipeline ()
 FileBackend::doOperations. More...
 testDoQuickOperations ()
 FileBackend::doQuickOperations. More...
 testExtensionFromPath ($path, $res)
 provider_testExtensionFromPath FileBackend::extensionFromPath More...
 testGetContentType ($mimeCallback, $mimeFromString)
 provider_testGetContentType More...
 testGetDirectoryList ()
 FileBackend::getTopDirectoryList FileBackend::getDirectoryList. More...
 testGetFileContents ($source, $content)
 provider_testGetFileContents FileBackend::getFileContents FileBackend::getFileContentsMulti More...
 testGetFileHttpUrl ($source, $content)
 provider_testGetFileHttpUrl FileBackend::getFileHttpUrl More...
 testGetFileList ()
 FileBackend::getFileList. More...
 testGetFileStat ($path, $content, $alreadyExists)
 provider_testGetFileStat FileBackend::getFileStat More...
 testGetLocalCopy ($source, $content)
 provider_testGetLocalCopy FileBackend::getLocalCopy More...
 testGetLocalCopyAndReference404 ()
 FileBackend::getLocalCopy FileBackend::getLocalReference. More...
 testGetLocalReference ($source, $content)
 provider_testGetLocalReference FileBackend::getLocalReference More...
 testIsStoragePath ($path, $isStorePath)
 provider_testIsStoragePath FileBackend::isStoragePath More...
 testLockCalls ()
 FileBackend::lockFiles FileBackend::unlockFiles. More...
 testMove ($op)
 provider_testMove FileBackend::doOperation More...
 testNormalizeStoragePath ($path, $res)
 provider_normalizeStoragePath FileBackend::normalizeStoragePath More...
 testParentStoragePath ($path, $res)
 provider_testParentStoragePath FileBackend::parentStoragePath More...
 testPrepareAndClean ($path, $isOK)
 provider_testPrepareAndClean FileBackend::prepare FileBackend::clean More...
 testReadAffinity ()
 testRecursiveClean ()
 testSanitizeOpHeaders ()
 testSplitStoragePath ($path, $res)
 provider_testSplitStoragePath FileBackend::splitStoragePath More...
 testStore ($op)
 provider_testStore More...
 testStreamFile ($path, $content, $alreadyExists)
 provider_testGetFileStat FileBackend::streamFile More...
 testStreamFileRange ()
- Public Member Functions inherited from MediaWikiTestCase
 __call ($func, $args)
 __construct ($name=null, array $data=[], $dataName= '')
 __destruct ()
 addDBData ()
 Stub. More...
 addDBDataOnce ()
 Stub. More...
 dbPrefix ()
 getCliArg ($offset)
 hideDeprecated ($function)
 Don't throw a warning if $function is deprecated and called later. More...
 needsDB ()
 run (PHPUnit_Framework_TestResult $result=null)
 setCliArg ($offset, $value)
 setContentLang ($lang)
 setupAllTestDBs ()
 Set up all test DBs. More...
 setUserLang ($lang)
 testMediaWikiTestCaseParentSetupCalled ()
 Make sure MediaWikiTestCase extending classes have called their parent setUp method. More...
 usesTemporaryTables ()

Static Public Member Functions

static provider_normalizeStoragePath ()
static provider_testConcatenate ()
static provider_testCopy ()
static provider_testCreate ()
 provider_testCreate More...
static provider_testDelete ()
static provider_testDescribe ()
static provider_testExtensionFromPath ()
static provider_testGetContentType ()
static provider_testGetFileContents ()
static provider_testGetFileHttpUrl ()
static provider_testGetFileStat ()
static provider_testGetLocalCopy ()
static provider_testGetLocalReference ()
static provider_testIsStoragePath ()
static provider_testMove ()
static provider_testParentStoragePath ()
static provider_testPrepareAndClean ()
static provider_testSplitStoragePath ()
static provider_testStore ()
static provider_testStreamFile ()
- Static Public Member Functions inherited from MediaWikiTestCase
static assertNotTag ($matcher, $actual, $message= '', $isHtml=true)
static assertTag ($matcher, $actual, $message= '', $isHtml=true)
 Note: we are overriding this method to remove the deprecated error. More...
static getMutableTestUser ($groups=[])
 Convenience method for getting a mutable test user. More...
static getTestSysop ()
 Convenience method for getting an immutable admin test user. More...
static getTestUser ($groups=[])
 Convenience method for getting an immutable test user. More...
static listTables (Database $db)
static prepareServices (Config $bootstrapConfig)
 Prepare service configuration for unit testing. More...
static setUpBeforeClass ()
static setupTestDB (Database $db, $prefix)
 Creates an empty skeleton of the wiki database by cloning its structure to equivalent tables using the given $prefix. More...
static teardownTestDB ()
 Restores MediaWiki to using the table set (table prefix) it was using before setupTestDB() was called. More...
static wfResetOutputBuffersBarrier ($buffer)
 Used as a marker to prevent wfResetOutputBuffers from breaking PHPUnit. More...

Public Attributes

FSFileBackend $singleBackend
- Public Attributes inherited from MediaWikiTestCase
const DB_PREFIX = 'unittest_'
 Table name prefixes. More...
const ORA_DB_PREFIX = 'ut_'

Protected Member Functions

 setUp ()
- Protected Member Functions inherited from MediaWikiTestCase
 addTmpFiles ($files)
 arrayWrap (array $elements)
 Utility method taking an array of elements and wrapping each element in its own array. More...
 assertArrayEquals (array $expected, array $actual, $ordered=false, $named=false)
 Assert that two arrays are equal. More...
 assertHTMLEquals ($expected, $actual, $msg= '')
 Put each HTML element on its own line and then equals() the results. More...
 assertSelect ($table, $fields, $condition, array $expectedRows)
 Asserts that the given database query yields the rows given by $expectedRows. More...
 assertType ($type, $actual, $message= '')
 Asserts the type of the provided value. More...
 assertTypeOrValue ($type, $actual, $value=false, $message= '')
 Asserts that the provided variable is of the specified internal type or equals the $value argument. More...
 assertValidHtmlDocument ($html)
 Asserts that the given string is valid HTML document. More...
 assertValidHtmlSnippet ($html)
 Asserts that the given string is a valid HTML snippet. More...
 checkDbIsSupported ()
 checkPHPExtension ($extName)
 Check if $extName is a loaded PHP extension, will skip the test whenever it is not loaded. More...
 getDefaultWikitextNS ()
 Returns the ID of a namespace that defaults to Wikitext. More...
 getNewTempDirectory ()
 obtains a new temporary directory More...
 getNewTempFile ()
 Obtains a new temporary file name. More...
 insertPage ($pageName, $text= 'Sample page for unit test.', $namespace=null)
 Insert a new page. More...
 isWikitextNS ($ns)
 Returns true if the given namespace defaults to Wikitext according to $wgNamespaceContentModels. More...
 markTestSkippedIfNoDiff3 ()
 Check, if $wgDiff3 is set and ready to merge Will mark the calling test as skipped, if not ready. More...
 mergeMwGlobalArrayValue ($name, $values)
 Merges the given values into a MW global array variable. More...
 objectAssociativeSort (array &$array)
 Does an associative sort that works for objects. More...
 overrideMwServices (Config $configOverrides=null, array $services=[])
 Stashes the global instance of MediaWikiServices, and installs a new one, allowing test cases to override settings and services. More...
 setLogger ($channel, LoggerInterface $logger)
 Sets the logger for a specified channel, for the duration of the test. More...
 setMwGlobals ($pairs, $value=null)
 setService ($name, $object)
 Sets a service, maintaining a stashed version of the previous service to be restored in tearDown. More...
 setTemporaryHook ($hookName, $handler)
 Create a temporary hook handler which will be reset by tearDown. More...
 setUp ()
 stashMwGlobals ($globalKeys)
 Stashes the global, will be restored in tearDown() More...
 tearDown ()

Private Member Functions

 assertHasHeaders (array $headers, array $attr)
 backendClass ()
 create (array $params)
 deleteFiles ($container)
 doTestConcatenate ($params, $srcs, $srcsContent, $alreadyExists, $okStatus)
 doTestCopy ($op)
 doTestCreate ($op, $alreadyExists, $okStatus, $newSize)
 doTestDelete ($op, $withSource, $okStatus)
 doTestDescribe ($op, $withSource, $okStatus)
 doTestDoOperations ()
 doTestDoOperationsFailing ()
 doTestDoOperationsPipeline ()
 doTestDoQuickOperations ()
 doTestGetDirectoryList ()
 doTestGetFileContents ($source, $content)
 doTestGetFileHttpUrl ($source, $content)
 doTestGetFileList ()
 doTestGetFileStat ($path, $content, $alreadyExists)
 doTestGetLocalCopy ($source, $content)
 doTestGetLocalReference ($source, $content)
 doTestLockCalls ()
 doTestMove ($op)
 doTestPrepareAndClean ($path, $isOK)
 doTestRecursiveClean ()
 FileBackend::clean. More...
 doTestStore ($op)
 FileBackend::doOperation. More...
 doTestStreamFile ($path, $content)
 doTestStreamFileRange ()
 listToArray ($iter)
 prepare (array $params)

Static Private Member Functions

static baseStorePath ()

Private Attributes

FileBackend $backend
FileBackendMultiWrite $multiBackend

Static Private Attributes

static $backendToUse

Additional Inherited Members

- Static Public Attributes inherited from MediaWikiTestCase
static TestUser[] $users
- Static Protected Member Functions inherited from MediaWikiTestCase
static getExternalStoreDatabaseConnections ()
 Gets master database connections for all of the ExternalStoreDB stores configured in $wgDefaultExternalStore. More...
static isUsingExternalStoreDB ()
 Check whether ExternalStoreDB is being used. More...
static resetGlobalServices (Config $bootstrapConfig=null)
 Reset global services, and install testing environment. More...
static setupDatabaseWithTestPrefix (Database $db, $prefix)
 Setups a database with the given prefix. More...
static setupExternalStoreTestDBs ($testPrefix)
 Clones the External Store database(s) for testing. More...
static stripStringKeys (&$r)
 Utility function for eliminating all string keys from an array. More...
- Protected Attributes inherited from MediaWikiTestCase
Database $db
 Primary database. More...
array $supportedDBs
array $tablesUsed = []

Detailed Description

FileRepo FileBackend medium.

Definition at line 8 of file FileBackendTest.php.

Member Function Documentation

FileBackendTest::assertBackendPathsConsistent ( array  $paths)
FileBackendTest::assertHasHeaders ( array  $headers,
array  $attr 

Definition at line 687 of file FileBackendTest.php.

References as.

Referenced by doTestDescribe().

static FileBackendTest::baseStorePath ( )

Definition at line 82 of file FileBackendTest.php.

FileBackendTest::deleteFiles (   $container)

Definition at line 2630 of file FileBackendTest.php.

References $base, and as.

Referenced by tearDownFiles().

FileBackendTest::doTestConcatenate (   $params,
FileBackendTest::doTestCopy (   $op)
FileBackendTest::doTestCreate (   $op,
FileBackendTest::doTestDelete (   $op,
FileBackendTest::doTestDescribe (   $op,
FileBackendTest::doTestDoOperations ( )

Definition at line 1691 of file FileBackendTest.php.

References $base, $status, assertGoodStatus(), create(), and prepare().

Referenced by testDoOperations().

FileBackendTest::doTestDoOperationsFailing ( )

Definition at line 1880 of file FileBackendTest.php.

References $base, $status, create(), and prepare().

Referenced by testDoOperationsFailing().

FileBackendTest::doTestDoOperationsPipeline ( )
FileBackendTest::doTestDoQuickOperations ( )

Definition at line 859 of file FileBackendTest.php.

References $base, $files, $path, $status, as, assertGoodStatus(), backendClass(), and prepare().

Referenced by testDoQuickOperations().

FileBackendTest::doTestGetDirectoryList ( )
FileBackendTest::doTestGetFileContents (   $source,
FileBackendTest::doTestGetFileHttpUrl (   $source,
FileBackendTest::doTestGetFileList ( )

Definition at line 1957 of file FileBackendTest.php.

References $base, $files, $status, as, assertGoodStatus(), backendClass(), listToArray(), and prepare().

Referenced by testGetFileList().

FileBackendTest::doTestGetFileStat (   $path,
FileBackendTest::doTestGetLocalCopy (   $source,
FileBackendTest::doTestGetLocalCopyAndReference404 ( )

Definition at line 1486 of file FileBackendTest.php.

References $base, and backendClass().

Referenced by testGetLocalCopyAndReference404().

FileBackendTest::doTestGetLocalReference (   $source,
FileBackendTest::doTestLockCalls ( )
FileBackendTest::doTestMove (   $op)
FileBackendTest::doTestPrepareAndClean (   $path,

Definition at line 1571 of file FileBackendTest.php.

References $path, $status, assertGoodStatus(), backendClass(), and prepare().

Referenced by testPrepareAndClean().

FileBackendTest::doTestRecursiveClean ( )
FileBackendTest::doTestStore (   $op)
FileBackendTest::doTestStreamFile (   $path,

Definition at line 1149 of file FileBackendTest.php.

References $content, $path, $status, assertGoodStatus(), backendClass(), create(), and prepare().

Referenced by testStreamFile().

FileBackendTest::doTestStreamFileRange ( )

Definition at line 1197 of file FileBackendTest.php.

References $base, $content, $path, $status, as, assertGoodStatus(), backendClass(), create(), and prepare().

Referenced by testStreamFileRange().

FileBackendTest::listToArray (   $iter)

Definition at line 2607 of file FileBackendTest.php.

Referenced by doTestGetDirectoryList(), and doTestGetFileList().

static FileBackendTest::provider_normalizeStoragePath ( )

Definition at line 149 of file FileBackendTest.php.

static FileBackendTest::provider_testConcatenate ( )

Definition at line 1009 of file FileBackendTest.php.

References $content, and $params.

static FileBackendTest::provider_testCopy ( )

Definition at line 360 of file FileBackendTest.php.

References $source.

static FileBackendTest::provider_testCreate ( )


Definition at line 792 of file FileBackendTest.php.

static FileBackendTest::provider_testDelete ( )

Definition at line 586 of file FileBackendTest.php.

References $source.

static FileBackendTest::provider_testDescribe ( )

Definition at line 701 of file FileBackendTest.php.

References $source.

static FileBackendTest::provider_testExtensionFromPath ( )

Definition at line 201 of file FileBackendTest.php.

static FileBackendTest::provider_testGetContentType ( )

Definition at line 2471 of file FileBackendTest.php.

References false, FileBackendGroup\singleton(), and true.

static FileBackendTest::provider_testGetFileContents ( )

Definition at line 1290 of file FileBackendTest.php.

References $base.

static FileBackendTest::provider_testGetFileHttpUrl ( )

Definition at line 1534 of file FileBackendTest.php.

References $base.

static FileBackendTest::provider_testGetFileStat ( )

Definition at line 1122 of file FileBackendTest.php.

References $base, false, and true.

static FileBackendTest::provider_testGetLocalCopy ( )

Definition at line 1375 of file FileBackendTest.php.

References $base.

static FileBackendTest::provider_testGetLocalReference ( )

Definition at line 1454 of file FileBackendTest.php.

References $base.

static FileBackendTest::provider_testIsStoragePath ( )

Definition at line 99 of file FileBackendTest.php.

References false, and true.

static FileBackendTest::provider_testMove ( )

Definition at line 482 of file FileBackendTest.php.

References $source.

static FileBackendTest::provider_testParentStoragePath ( )

Definition at line 179 of file FileBackendTest.php.

static FileBackendTest::provider_testPrepareAndClean ( )

Definition at line 1560 of file FileBackendTest.php.

References $base, and true.

static FileBackendTest::provider_testSplitStoragePath ( )

Definition at line 124 of file FileBackendTest.php.

static FileBackendTest::provider_testStore ( )

Definition at line 268 of file FileBackendTest.php.

References TempFSFile\factory(), and wfTempDir().

static FileBackendTest::provider_testStreamFile ( )

Definition at line 1175 of file FileBackendTest.php.

References $base.

FileBackendTest::testAsyncWrites ( )
FileBackendTest::testConcatenate (   $op,


Definition at line 934 of file FileBackendTest.php.

References $multiBackend, $singleBackend, doTestConcatenate(), and tearDownFiles().

FileBackendTest::testCopy (   $op)

provider_testCopy FileBackend::doOperation

Definition at line 291 of file FileBackendTest.php.

References $multiBackend, $singleBackend, doTestCopy(), and tearDownFiles().

FileBackendTest::testCreate (   $op,

provider_testCreate FileBackend::doOperation

Definition at line 727 of file FileBackendTest.php.

References $multiBackend, $singleBackend, doTestCreate(), and tearDownFiles().

FileBackendTest::testDelete (   $op,

provider_testDelete FileBackend::doOperation

Definition at line 534 of file FileBackendTest.php.

References $multiBackend, $singleBackend, doTestDelete(), and tearDownFiles().

FileBackendTest::testDescribe (   $op,

provider_testDescribe FileBackend::doOperation

Definition at line 626 of file FileBackendTest.php.

References $multiBackend, $singleBackend, doTestDescribe(), and tearDownFiles().

FileBackendTest::testDoOperations ( )
FileBackendTest::testDoOperationsFailing ( )
FileBackendTest::testDoOperationsPipeline ( )
FileBackendTest::testDoQuickOperations ( )
FileBackendTest::testExtensionFromPath (   $path,

provider_testExtensionFromPath FileBackend::extensionFromPath

Definition at line 196 of file FileBackendTest.php.

References $path, $res, and FileBackend\extensionFromPath().

FileBackendTest::testGetContentType (   $mimeCallback,


Definition at line 2445 of file FileBackendTest.php.

References $IP, global, and TestingAccessWrapper\newFromObject().

FileBackendTest::testGetFileContents (   $source,
FileBackendTest::testGetFileHttpUrl (   $source,

provider_testGetFileHttpUrl FileBackend::getFileHttpUrl

Definition at line 1504 of file FileBackendTest.php.

References $content, $multiBackend, $singleBackend, $source, doTestGetFileHttpUrl(), and tearDownFiles().

FileBackendTest::testGetFileList ( )
FileBackendTest::testGetFileStat (   $path,

provider_testGetFileStat FileBackend::getFileStat

Definition at line 1061 of file FileBackendTest.php.

References $content, $multiBackend, $path, $singleBackend, doTestGetFileStat(), and tearDownFiles().

FileBackendTest::testGetLocalCopy (   $source,

provider_testGetLocalCopy FileBackend::getLocalCopy

Definition at line 1309 of file FileBackendTest.php.

References $content, $multiBackend, $singleBackend, $source, doTestGetLocalCopy(), and tearDownFiles().

FileBackendTest::testGetLocalCopyAndReference404 ( )
FileBackendTest::testGetLocalReference (   $source,

provider_testGetLocalReference FileBackend::getLocalReference

Definition at line 1395 of file FileBackendTest.php.

References $content, $multiBackend, $singleBackend, $source, doTestGetLocalReference(), and tearDownFiles().

FileBackendTest::testIsStoragePath (   $path,

provider_testIsStoragePath FileBackend::isStoragePath

Definition at line 94 of file FileBackendTest.php.

References $path, and FileBackend\isStoragePath().

FileBackendTest::testLockCalls ( )
FileBackendTest::testMove (   $op)

provider_testMove FileBackend::doOperation

Definition at line 412 of file FileBackendTest.php.

References $multiBackend, $singleBackend, doTestMove(), and tearDownFiles().

FileBackendTest::testNormalizeStoragePath (   $path,

provider_normalizeStoragePath FileBackend::normalizeStoragePath

Definition at line 144 of file FileBackendTest.php.

References $path, $res, and FileBackend\normalizeStoragePath().

FileBackendTest::testParentStoragePath (   $path,

provider_testParentStoragePath FileBackend::parentStoragePath

Definition at line 174 of file FileBackendTest.php.

References $path, $res, and FileBackend\parentStoragePath().

FileBackendTest::testPrepareAndClean (   $path,
FileBackendTest::testReadAffinity ( )

Definition at line 2478 of file FileBackendTest.php.

References TestingAccessWrapper\newFromObject(), and wfWikiID().

FileBackendTest::testRecursiveClean ( )
FileBackendTest::testSanitizeOpHeaders ( )
FileBackendTest::testSplitStoragePath (   $path,

provider_testSplitStoragePath FileBackend::splitStoragePath

Definition at line 119 of file FileBackendTest.php.

References $path, $res, and FileBackend\splitStoragePath().

FileBackendTest::testStore (   $op)


Definition at line 213 of file FileBackendTest.php.

References $multiBackend, $singleBackend, MediaWikiTestCase\addTmpFiles(), doTestStore(), and tearDownFiles().

FileBackendTest::testStreamFile (   $path,

provider_testGetFileStat FileBackend::streamFile

Definition at line 1137 of file FileBackendTest.php.

References $content, $multiBackend, $path, $singleBackend, doTestStreamFile(), and tearDownFiles().

FileBackendTest::testStreamFileRange ( )

Member Data Documentation

FileBackend FileBackendTest::$backend

Definition at line 11 of file FileBackendTest.php.


Definition at line 16 of file FileBackendTest.php.

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