MediaWiki
1.32.5
|
Static Public Member Functions | |
static | provideCheckTitleEncodingData () |
static | provideCommafyData () |
static | provideFormatBitrate () |
static | provideFormatDuration () |
static | provideFormatSizes () |
static | provideFormattableTimes () |
static | provideGetNamespaceAliases () |
static | provideGetParentLanguage () |
static | provideHebrewNumeralsData () |
static | provideHTMLTruncateData () |
static | provideIsSupportedLanguage () |
static | provideKnownLanguageTags () |
static | provideLanguageCodes () |
static | provideMalformedLanguageTags () |
The test cases are based on the tests in the GaBuZoMeu parser written by Stéphane Bortzmeyer bortz and distributed as free software, under the GNU General Public Licence. meye r@nic .frMore... | |
static | providePluralData () |
static | provideRomanNumeralsData () |
static | provideSprintfDateSamples () |
static | provideTranslateBlockExpiry () |
static | provideTruncateData () |
static | provideUnknownLanguageTags () |
static | provideWellFormedLanguageTags () |
The test cases are based on the tests in the GaBuZoMeu parser written by Stéphane Bortzmeyer bortz and distributed as free software, under the GNU General Public Licence. meye r@nic .frMore... | |
Static Public Member Functions inherited from MediaWikiTestCase | |
static | getMutableTestUser ( $groups=[]) |
Convenience method for getting a mutable test user. More... | |
static | getTestPrefixFor (IDatabase $db) |
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 | installMockMwServices (Config $configOverrides=null) |
Creates a new "mock" MediaWikiServices instance, and installs it. More... | |
static | listTables (IMaintainableDatabase $db) |
static | prepareServices (Config $bootstrapConfig) |
static | resetNonServiceCaches () |
Resets some non-service singleton instances and other static caches. More... | |
static | restoreMwServices () |
Restores the original, non-mock MediaWikiServices instance. 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... | |
Additional Inherited Members | |
Public Attributes inherited from MediaWikiTestCase | |
const | DB_PREFIX = 'unittest_' |
Table name prefixes. More... | |
const | ORA_DB_PREFIX = 'ut_' |
Static Public Attributes inherited from MediaWikiTestCase | |
static TestUser[] | $users |
Protected Member Functions inherited from LanguageClassesTestCase | |
getLang () | |
setUp () | |
Create a new language object before each test. More... | |
tearDown () | |
Delete the internal language object so each test start out with a fresh language instance. More... | |
Protected Member Functions inherited from MediaWikiTestCase | |
addCoreDBData () | |
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... | |
assertFileContains ( $fileName, $actualData, $createIfMissing=false, $msg='') | |
Check whether file contains given data. 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, array $options=[], array $join_conds=[]) | |
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... | |
checkDbIsSupported () | |
checkPHPExtension ( $extName) | |
Check if $extName is a loaded PHP extension, will skip the test whenever it is not loaded. More... | |
editPage ( $pageName, $text, $summary='', $defaultNs=NS_MAIN) | |
Edits or creates a page/revision. More... | |
ensureMockDatabaseConnection (IDatabase $db) | |
getDefaultWikitextNS () | |
Returns the ID of a namespace that defaults to Wikitext. More... | |
getExistingTestPage ( $title=null) | |
Returns a WikiPage representing an existing page. More... | |
getNewTempDirectory () | |
obtains a new temporary directory More... | |
getNewTempFile () | |
Obtains a new temporary file name. More... | |
getNonexistingTestPage ( $title=null) | |
Returns a WikiPage representing a non-existing page. More... | |
getSchemaOverrides (IMaintainableDatabase $db) | |
Stub. More... | |
insertPage ( $pageName, $text='Sample page for unit test.', $namespace=null, User $user=null) | |
Insert a new page. More... | |
isTestInDatabaseGroup () | |
isWikitextNS ( $ns) | |
Returns true if the given namespace defaults to Wikitext according to $wgNamespaceContentModels. More... | |
markTestSkippedIfDbType ( $type) | |
Skip the test if using the specified database type. 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... | |
revisionDelete ( $rev, array $value=[Revision::DELETED_TEXT=> 1], $comment='') | |
Revision-deletes a revision. More... | |
setIniSetting ( $name, $value) | |
Set an ini setting for the duration of the test. More... | |
setLogger ( $channel, LoggerInterface $logger) | |
Sets the logger for a specified channel, for the duration of the test. More... | |
setMwGlobals ( $pairs, $value=null) | |
Sets a global, maintaining a stashed version of the previous global to be restored in tearDown. More... | |
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... | |
stashMwGlobals ( $globalKeys) | |
Stashes the global, will be restored in tearDown() More... | |
truncateTable ( $tableName, IDatabase $db=null) | |
Empties the given table and resets any auto-increment counters. More... | |
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 | setupDatabaseWithTestPrefix (IMaintainableDatabase $db, $prefix=null) |
Setups a database with cloned tables using the given prefix. More... | |
static | setupExternalStoreTestDBs ( $testPrefix=null) |
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 = [] |
Definition at line 5 of file LanguageTest.php.
LanguageTest::parseFormattedNumberProvider | ( | ) |
Definition at line 1736 of file LanguageTest.php.
|
static |
Definition at line 1392 of file LanguageTest.php.
|
static |
Definition at line 1759 of file LanguageTest.php.
|
static |
Definition at line 1183 of file LanguageTest.php.
|
static |
Definition at line 1255 of file LanguageTest.php.
LanguageTest::provideFormatNum | ( | ) |
Definition at line 1710 of file LanguageTest.php.
|
static |
Definition at line 1120 of file LanguageTest.php.
|
static |
Definition at line 28 of file LanguageTest.php.
References true.
|
static |
Definition at line 1889 of file LanguageTest.php.
References NS_FILE.
|
static |
Definition at line 1866 of file LanguageTest.php.
|
static |
Definition at line 1518 of file LanguageTest.php.
|
static |
Definition at line 327 of file LanguageTest.php.
|
static |
Definition at line 1844 of file LanguageTest.php.
|
static |
Definition at line 536 of file LanguageTest.php.
|
static |
Definition at line 513 of file LanguageTest.php.
|
static |
The test cases are based on the tests in the GaBuZoMeu parser written by Stéphane Bortzmeyer bortz and distributed as free software, under the GNU General Public Licence. meye r@nic .fr
http://www.bortzmeyer.org/gabuzomeu-parsing-language-tags.html
Definition at line 453 of file LanguageTest.php.
|
static |
Definition at line 1586 of file LanguageTest.php.
|
static |
Definition at line 1459 of file LanguageTest.php.
|
static |
Definition at line 694 of file LanguageTest.php.
|
static |
Definition at line 1662 of file LanguageTest.php.
References wfTimestamp().
|
static |
Definition at line 296 of file LanguageTest.php.
References false.
|
static |
Definition at line 572 of file LanguageTest.php.
|
static |
The test cases are based on the tests in the GaBuZoMeu parser written by Stéphane Bortzmeyer bortz and distributed as free software, under the GNU General Public Licence. meye r@nic .fr
http://www.bortzmeyer.org/gabuzomeu-parsing-language-tags.html
Definition at line 401 of file LanguageTest.php.
LanguageTest::testBuiltInCodeValidation | ( | $code, | |
$expected, | |||
$message = '' |
|||
) |
Test Language::isValidBuiltInCode() provideLanguageCodes Language::isValidBuiltInCode.
Definition at line 506 of file LanguageTest.php.
References $code, and Language\isValidBuiltInCode().
LanguageTest::testCheckTitleEncoding | ( | $s | ) |
provideCheckTitleEncodingData Language::checkTitleEncoding
Definition at line 1384 of file LanguageTest.php.
References $s, and LanguageClassesTestCase\getLang().
LanguageTest::testClearCaches | ( | ) |
Definition at line 1800 of file LanguageTest.php.
References Language\$dataCache, $lang, Language\$mLangObjCache, class, Language\clearCaches(), Language\factory(), Language\fetchLanguageNames(), Language\getFallbacksIncludingSiteLanguage(), and Language\getLocalisationCache().
LanguageTest::testCommafy | ( | $number, | |
$numbersWithCommas | |||
) |
Language::commafy() provideCommafyData.
Definition at line 1751 of file LanguageTest.php.
References LanguageClassesTestCase\getLang().
LanguageTest::testConvertPlural | ( | $expected, | |
$number, | |||
$forms | |||
) |
providePluralData Language::convertPlural
Definition at line 1581 of file LanguageTest.php.
References LanguageClassesTestCase\getLang().
LanguageTest::testEmbedBidi | ( | ) |
Definition at line 1625 of file LanguageTest.php.
References $lang, and LanguageClassesTestCase\getLang().
LanguageTest::testEquals | ( | ) |
LanguageTest::testFormatBitrate | ( | $bps, | |
$expected, | |||
$msg | |||
) |
provideFormatBitrate Language::formatBitrate
Definition at line 1175 of file LanguageTest.php.
References LanguageClassesTestCase\getLang().
LanguageTest::testFormatDuration | ( | $duration, | |
$expected, | |||
$intervals = [] |
|||
) |
provideFormatDuration Language::formatDuration
Definition at line 1247 of file LanguageTest.php.
References LanguageClassesTestCase\getLang().
LanguageTest::testFormatNum | ( | $translateNumerals, | |
$langCode, | |||
$number, | |||
$nocommafy, | |||
$expected | |||
) |
provideFormatNum Language::formatNum
Definition at line 1700 of file LanguageTest.php.
References $lang, MediaWikiTestCase\assertType(), Language\factory(), and MediaWikiTestCase\setMwGlobals().
LanguageTest::testFormatSize | ( | $size, | |
$expected, | |||
$msg | |||
) |
provideFormatSizes Language::formatSize
Definition at line 1112 of file LanguageTest.php.
References LanguageClassesTestCase\getLang().
LanguageTest::testFormatTimePeriod | ( | $seconds, | |
$format, | |||
$expected, | |||
$desc | |||
) |
provideFormattableTimes Language::formatTimePeriod
Definition at line 24 of file LanguageTest.php.
References LanguageClassesTestCase\getLang().
LanguageTest::testGetNamespaceAliases | ( | $languageCode, | |
$subset | |||
) |
provideGetNamespaceAliases Language::getNamespaceAliases
Definition at line 1881 of file LanguageTest.php.
References as, and Language\factory().
LanguageTest::testGetParentLanguage | ( | $code, | |
$expected, | |||
$comment | |||
) |
provideGetParentLanguage Language::getParentLanguage
Definition at line 1857 of file LanguageTest.php.
References $code, $lang, and Language\factory().
LanguageTest::testHasVariant | ( | ) |
Definition at line 1905 of file LanguageTest.php.
References Language\factory().
LanguageTest::testHebrewNumeral | ( | $num, | |
$numerals | |||
) |
provideHebrewNumeralsData Language::hebrewNumeral
Definition at line 1510 of file LanguageTest.php.
References Language\hebrewNumeral().
LanguageTest::testIsSupportedLanguage | ( | $code, | |
$expected, | |||
$comment | |||
) |
provideIsSupportedLanguage Language::isSupportedLanguage
Definition at line 1840 of file LanguageTest.php.
References $code, and Language\isSupportedLanguage().
LanguageTest::testKnownCldrLanguageTag | ( | ) |
Definition at line 547 of file LanguageTest.php.
References Language\isKnownLanguageTag().
LanguageTest::testKnownLanguageTag | ( | $code, | |
$message = '' |
|||
) |
Test Language::isKnownLanguageTag() provideKnownLanguageTags Language::isKnownLanguageTag.
Definition at line 529 of file LanguageTest.php.
References $code, and Language\isKnownLanguageTag().
LanguageTest::testLanguageConvertDoubleWidthToSingleWidth | ( | ) |
Language::convertDoubleWidth Language::normalizeForSearch.
Definition at line 10 of file LanguageTest.php.
References LanguageClassesTestCase\getLang().
LanguageTest::testLenientLanguageTag | ( | ) |
Negative test for Language::isWellFormedLanguageTag() Language::isWellFormedLanguageTag.
Definition at line 494 of file LanguageTest.php.
References Language\isWellFormedLanguageTag().
LanguageTest::testListToText | ( | ) |
Definition at line 1784 of file LanguageTest.php.
References $lang, $s, and LanguageClassesTestCase\getLang().
LanguageTest::testMalformedLanguageTag | ( | $code, | |
$message = '' |
|||
) |
Negative test for Language::isWellFormedLanguageTag() provideMalformedLanguageTags Language::isWellFormedLanguageTag.
Definition at line 440 of file LanguageTest.php.
References $code, and Language\isWellFormedLanguageTag().
LanguageTest::testParseFormattedNumber | ( | $langCode, | |
$number | |||
) |
Language::parseFormattedNumber parseFormattedNumberProvider.
Definition at line 1727 of file LanguageTest.php.
References $lang, and Language\factory().
LanguageTest::testRomanNumerals | ( | $num, | |
$numerals | |||
) |
provideRomanNumeralsData Language::romanNumeral
Definition at line 1451 of file LanguageTest.php.
References Language\romanNumeral().
LanguageTest::testSprintfDate | ( | $format, | |
$ts, | |||
$expected, | |||
$msg | |||
) |
provideSprintfDateSamples Language::sprintfDate
Definition at line 610 of file LanguageTest.php.
References LanguageClassesTestCase\getLang().
LanguageTest::testSprintfDateNotAllDigitTimestamp | ( | ) |
Test too short timestamp MWException Language::sprintfDate.
Definition at line 602 of file LanguageTest.php.
References LanguageClassesTestCase\getLang().
LanguageTest::testSprintfDateNoTtlIfNotNeeded | ( | ) |
sprintfDate should only calculate a TTL if the caller is going to use it.
Definition at line 680 of file LanguageTest.php.
References LanguageClassesTestCase\getLang(), and wfTimestampNow().
LanguageTest::testSprintfDateNoZone | ( | $format, | |
$ts, | |||
$expected, | |||
$ignore, | |||
$msg | |||
) |
sprintfDate should always use UTC when no zone is given.
provideSprintfDateSamples Language::sprintfDate
Definition at line 642 of file LanguageTest.php.
References $res, and LanguageClassesTestCase\getLang().
LanguageTest::testSprintfDateTooLongTimestamp | ( | ) |
Test too long timestamp MWException Language::sprintfDate.
Definition at line 593 of file LanguageTest.php.
References LanguageClassesTestCase\getLang().
LanguageTest::testSprintfDateTooShortTimestamp | ( | ) |
Test too short timestamp MWException Language::sprintfDate.
Definition at line 584 of file LanguageTest.php.
References LanguageClassesTestCase\getLang().
LanguageTest::testSprintfDateTZ | ( | $format, | |
$ts, | |||
$ignore, | |||
$expected, | |||
$msg | |||
) |
sprintfDate should use passed timezone provideSprintfDateSamples Language::sprintfDate
Definition at line 663 of file LanguageTest.php.
References LanguageClassesTestCase\getLang().
LanguageTest::testTranslateBlockExpiry | ( | $expectedData, | |
$str, | |||
$now, | |||
$desc | |||
) |
Language::translateBlockExpiry() provideTranslateBlockExpiry.
Definition at line 1651 of file LanguageTest.php.
References $lang, LanguageClassesTestCase\getLang(), and list.
LanguageTest::testTruncateForDatabase | ( | ) |
Language::truncateForDatabase Language::truncateInternal.
Definition at line 217 of file LanguageTest.php.
References LanguageClassesTestCase\getLang().
LanguageTest::testTruncateForVisual | ( | $expected, | |
$string, | |||
$length, | |||
$ellipsis = '...' , |
|||
$adjustLength = true |
|||
) |
provideTruncateData Language::truncateForVisual Language::truncateInternal
Definition at line 284 of file LanguageTest.php.
References LanguageClassesTestCase\getLang().
LanguageTest::testTruncateHtml | ( | $len, | |
$ellipsis, | |||
$input, | |||
$expected | |||
) |
provideHTMLTruncateData Language::truncateHTML
Definition at line 316 of file LanguageTest.php.
References $input, and LanguageClassesTestCase\getLang().
LanguageTest::testUnknownLanguageTag | ( | $code, | |
$message = '' |
|||
) |
Negative tests for Language::isKnownLanguageTag() provideUnKnownLanguageTags Language::isKnownLanguageTag.
Definition at line 565 of file LanguageTest.php.
References $code, and Language\isKnownLanguageTag().
LanguageTest::testWellFormedLanguageTag | ( | $code, | |
$message = '' |
|||
) |
Test Language::isWellFormedLanguageTag() provideWellFormedLanguageTags Language::isWellFormedLanguageTag.
Definition at line 388 of file LanguageTest.php.
References $code, and Language\isWellFormedLanguageTag().