MediaWiki  1.28.0
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 
)
private

Definition at line 687 of file FileBackendTest.php.

References as.

Referenced by doTestDescribe().

static FileBackendTest::baseStorePath ( )
staticprivate

Definition at line 82 of file FileBackendTest.php.

FileBackendTest::deleteFiles (   $container)
private

Definition at line 2630 of file FileBackendTest.php.

References $base, and as.

Referenced by tearDownFiles().

FileBackendTest::doTestConcatenate (   $params,
  $srcs,
  $srcsContent,
  $alreadyExists,
  $okStatus 
)
private
FileBackendTest::doTestCopy (   $op)
private
FileBackendTest::doTestCreate (   $op,
  $alreadyExists,
  $okStatus,
  $newSize 
)
private
FileBackendTest::doTestDelete (   $op,
  $withSource,
  $okStatus 
)
private
FileBackendTest::doTestDescribe (   $op,
  $withSource,
  $okStatus 
)
private
FileBackendTest::doTestDoOperations ( )
private

Definition at line 1691 of file FileBackendTest.php.

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

Referenced by testDoOperations().

FileBackendTest::doTestDoOperationsFailing ( )
private

Definition at line 1880 of file FileBackendTest.php.

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

Referenced by testDoOperationsFailing().

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

Definition at line 859 of file FileBackendTest.php.

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

Referenced by testDoQuickOperations().

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

Definition at line 1957 of file FileBackendTest.php.

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

Referenced by testGetFileList().

FileBackendTest::doTestGetFileStat (   $path,
  $content,
  $alreadyExists 
)
private
FileBackendTest::doTestGetLocalCopy (   $source,
  $content 
)
private
FileBackendTest::doTestGetLocalCopyAndReference404 ( )

Definition at line 1486 of file FileBackendTest.php.

References $base, and backendClass().

Referenced by testGetLocalCopyAndReference404().

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

Definition at line 1571 of file FileBackendTest.php.

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

Referenced by testPrepareAndClean().

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

Definition at line 1149 of file FileBackendTest.php.

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

Referenced by testStreamFile().

FileBackendTest::doTestStreamFileRange ( )
private

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)
private

Definition at line 2607 of file FileBackendTest.php.

Referenced by doTestGetDirectoryList(), and doTestGetFileList().

static FileBackendTest::provider_normalizeStoragePath ( )
static

Definition at line 149 of file FileBackendTest.php.

static FileBackendTest::provider_testConcatenate ( )
static

Definition at line 1009 of file FileBackendTest.php.

References $content, and $params.

static FileBackendTest::provider_testCopy ( )
static

Definition at line 360 of file FileBackendTest.php.

References $source.

static FileBackendTest::provider_testCreate ( )
static

provider_testCreate

Definition at line 792 of file FileBackendTest.php.

static FileBackendTest::provider_testDelete ( )
static

Definition at line 586 of file FileBackendTest.php.

References $source.

static FileBackendTest::provider_testDescribe ( )
static

Definition at line 701 of file FileBackendTest.php.

References $source.

static FileBackendTest::provider_testExtensionFromPath ( )
static

Definition at line 201 of file FileBackendTest.php.

static FileBackendTest::provider_testGetContentType ( )
static

Definition at line 2471 of file FileBackendTest.php.

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

static FileBackendTest::provider_testGetFileContents ( )
static

Definition at line 1290 of file FileBackendTest.php.

References $base.

static FileBackendTest::provider_testGetFileHttpUrl ( )
static

Definition at line 1534 of file FileBackendTest.php.

References $base.

static FileBackendTest::provider_testGetFileStat ( )
static

Definition at line 1122 of file FileBackendTest.php.

References $base, false, and true.

static FileBackendTest::provider_testGetLocalCopy ( )
static

Definition at line 1375 of file FileBackendTest.php.

References $base.

static FileBackendTest::provider_testGetLocalReference ( )
static

Definition at line 1454 of file FileBackendTest.php.

References $base.

static FileBackendTest::provider_testIsStoragePath ( )
static

Definition at line 99 of file FileBackendTest.php.

References false, and true.

static FileBackendTest::provider_testMove ( )
static

Definition at line 482 of file FileBackendTest.php.

References $source.

static FileBackendTest::provider_testParentStoragePath ( )
static

Definition at line 179 of file FileBackendTest.php.

static FileBackendTest::provider_testPrepareAndClean ( )
static

Definition at line 1560 of file FileBackendTest.php.

References $base, and true.

static FileBackendTest::provider_testSplitStoragePath ( )
static

Definition at line 124 of file FileBackendTest.php.

static FileBackendTest::provider_testStore ( )
static

Definition at line 268 of file FileBackendTest.php.

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

static FileBackendTest::provider_testStreamFile ( )
static

Definition at line 1175 of file FileBackendTest.php.

References $base.

FileBackendTest::testAsyncWrites ( )
FileBackendTest::testConcatenate (   $op,
  $srcs,
  $srcsContent,
  $alreadyExists,
  $okStatus 
)

provider_testConcatenate

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,
  $alreadyExists,
  $okStatus,
  $newSize 
)

provider_testCreate FileBackend::doOperation

Definition at line 727 of file FileBackendTest.php.

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

FileBackendTest::testDelete (   $op,
  $withSource,
  $okStatus 
)

provider_testDelete FileBackend::doOperation

Definition at line 534 of file FileBackendTest.php.

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

FileBackendTest::testDescribe (   $op,
  $withSource,
  $okStatus 
)

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,
  $res 
)

provider_testExtensionFromPath FileBackend::extensionFromPath

Definition at line 196 of file FileBackendTest.php.

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

FileBackendTest::testGetContentType (   $mimeCallback,
  $mimeFromString 
)

provider_testGetContentType

Definition at line 2445 of file FileBackendTest.php.

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

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

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,
  $content,
  $alreadyExists 
)

provider_testGetFileStat FileBackend::getFileStat

Definition at line 1061 of file FileBackendTest.php.

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

FileBackendTest::testGetLocalCopy (   $source,
  $content 
)

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,
  $content 
)

provider_testGetLocalReference FileBackend::getLocalReference

Definition at line 1395 of file FileBackendTest.php.

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

FileBackendTest::testIsStoragePath (   $path,
  $isStorePath 
)

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,
  $res 
)

provider_normalizeStoragePath FileBackend::normalizeStoragePath

Definition at line 144 of file FileBackendTest.php.

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

FileBackendTest::testParentStoragePath (   $path,
  $res 
)

provider_testParentStoragePath FileBackend::parentStoragePath

Definition at line 174 of file FileBackendTest.php.

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

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

Definition at line 2478 of file FileBackendTest.php.

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

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

provider_testSplitStoragePath FileBackend::splitStoragePath

Definition at line 119 of file FileBackendTest.php.

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

FileBackendTest::testStore (   $op)

provider_testStore

Definition at line 213 of file FileBackendTest.php.

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

FileBackendTest::testStreamFile (   $path,
  $content,
  $alreadyExists 
)

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
private

Definition at line 11 of file FileBackendTest.php.

FileBackendTest::$backendToUse
staticprivate

Definition at line 16 of file FileBackendTest.php.


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