MediaWiki
REL1_22
|
Inherited by ArticleTest, AutoLoaderTest, BagOStuffTest, BaseDumpTest, BitmapMetadataHandlerTest, BitmapScalingTest, CdbTest, CLDRPluralRuleEvaluatorTest, CleanUpTest, ContentHandlerTest, CssContentTest, CSSJanusTest, CSSMinTest, DatabaseMysqlBaseTest, DatabaseSqliteTest, DatabaseSQLTest, DatabaseTest, DiffHistoryBlobTest, DummyExtensionsTest, ExifBitmapTest, ExifRotationTest, ExifTest, ExternalStoreTest, ExtraParserTest, FallbackTest, FauxRequestTest, FauxResponseTest, FetchTextTest, FileBackendTest, FileRepoTest, FormatJsonTest, FormatMetadataTest, FormOptionsInitializationTest, FormOptionsTest, GenericArrayObjectTest, GetSlaveServerTest, GIFHandlerTest, GIFMetadataExtractorTest, GlobalTest, GlobalWithDBTest, HashRingTest, HooksTest, HtmlCheckMatrixTest, HtmlFormatterTest, HtmlTest, HttpTest, IEUrlExtensionTest, InstallDocFormatterTest, IPTCTest, IPTest, JavaScriptMinifierTest, JobQueueTest, JpegMetadataExtractorTest, JpegTest, LanguageClassesTestCase, LicensesTest, LinksUpdateTest, LocalFileTest, LocalisationCacheTest, MagicVariableTest, MaintenanceTest, MediaHandlerTest, MediaWikiLangTestCase, MWDebugTest, MWExceptionHandlerTest, MWFunctionTest, MWNamespaceTest, NewParserTest, OracleInstallerTest, ORMRowTest, ORMTableTest, OutputPageTest, ParserOutputTest, ParserPreloadTest, PathRouterTest, PNGHandlerTest, PNGMetadataExtractorTest, PreferencesTest, PrefixUniquenessTest, PreprocessorTest, ProcessCacheLRUTest, QueryAllSpecialPagesTest, RecentChangeTest, RequestContextTest, ResourceLoaderTest, ResourcesTest, RevisionStorageTest, RevisionTest, SanitizerTest, SanitizerValidateEmailTest, SearchUpdateTest, SiteConfigurationTest, SiteListTest, SiteSQLStoreTest, SiteTest, SpecialPreferencesTest, SpecialRecentchangesTest, SpecialSearchTest, StoreBatchTest, StringUtilsTest, StructureTest, SVGMetadataExtractorTest, TagHookTest, TidyTest, TiffTest, TitleMethodsTest, TitleTest, UIDGeneratorTest, UploadBaseTest, UploadStashTest, UserTest, WebRequestTest, WfAssembleUrlTest, WfBaseConvertTest, WfBaseNameTest, WfBCP47Test, WfExpandUrlTest, WfGetCallerTest, WfParseUrlTest, WfRemoveDotSegmentsTest, WfShorthandToIntegerTest, WfTimestampTest, WfUrlencodeTest, XmlJs, XmlSelectTest, XmlTest, XmlTypeCheckTest, XMPTest, XMPValidateTest, and ZipDirectoryReaderTest.
Public Member Functions | |
__call ($func, $args) | |
__construct ($name=null, array $data=array(), $dataName= '') | |
addDBData () | |
Stub. | |
dbPrefix () | |
getCliArg ($offset) | |
hideDeprecated ($function) | |
Don't throw a warning if $function is deprecated and called later. | |
needsDB () | |
run (PHPUnit_Framework_TestResult $result=null) | |
setCliArg ($offset, $value) | |
testMediaWikiTestCaseParentSetupCalled () | |
Make sure MediaWikiTestCase extending classes have called their parent setUp method. | |
usesTemporaryTables () | |
Static Public Member Functions | |
static | listTables ($db) |
static | setupTestDB (DatabaseBase $db, $prefix) |
Creates an empty skeleton of the wiki database by cloning its structure to equivalent tables using the given $prefix. | |
static | teardownTestDB () |
Restores MediaWiki to using the table set (table prefix) it was using before setupTestDB() was called. | |
Public Attributes | |
$regex = '' | |
$runDisabled = false | |
$suite | |
const | DB_PREFIX = 'unittest_' |
Table name prefixes. | |
const | ORA_DB_PREFIX = 'ut_' |
Static Public Attributes | |
static | $users |
Protected Member Functions | |
arrayWrap (array $elements) | |
Utility method taking an array of elements and wrapping each element in it's own array. | |
assertArrayEquals (array $expected, array $actual, $ordered=false, $named=false) | |
Assert that two arrays are equal. | |
assertException ($code, $expected= 'Exception', $message= '') | |
Asserts that an exception of the specified type occurs when running the provided code. | |
assertHTMLEquals ($expected, $actual, $msg= '') | |
Put each HTML element on its own line and then equals() the results. | |
assertSelect ($table, $fields, $condition, array $expectedRows) | |
Asserts that the given database query yields the rows given by $expectedRows. | |
assertType ($type, $actual, $message= '') | |
Asserts the type of the provided value. | |
assertTypeOrValue ($type, $actual, $value=false, $message= '') | |
Asserts that the provided variable is of the specified internal type or equals the $value argument. | |
checkDbIsSupported () | |
checkHasDiff3 () | |
Check, if $wgDiff3 is set and ready to merge Will mark the calling test as skipped, if not ready. | |
checkHasGzip () | |
Check whether we have the 'gzip' commandline utility, will skip the test whenever "gzip -V" fails. | |
checkPHPExtension ($extName) | |
Check if $extName is a loaded PHP extension, will skip the test whenever it is not loaded. | |
getDefaultWikitextNS () | |
Returns the ID of a namespace that defaults to Wikitext. | |
getNewTempDirectory () | |
obtains a new temporary directory | |
getNewTempFile () | |
obtains a new temporary file name | |
isWikitextNS ($ns) | |
Returns true if the given namespace defaults to Wikitext according to $wgNamespaceContentModels. | |
mergeMwGlobalArrayValue ($name, $values) | |
Merges the given values into a MW global array variable. | |
objectAssociativeSort (array &$array) | |
Does an associative sort that works for objects. | |
setMwGlobals ($pairs, $value=null) | |
setUp () | |
setUp and tearDown should (where significant) happen in reverse order. | |
tearDown () | |
Static Protected Member Functions | |
static | stripStringKeys (&$r) |
Utility function for eliminating all string keys from an array. | |
Protected Attributes | |
DatabaseBase | $db |
$supportedDBs | |
$tablesUsed = array() | |
Private Member Functions | |
addCoreDBData () | |
assertEmpty2 ($value, $msg) | |
resetDB () | |
Empty all tables so they can be repopulated for tests. | |
Static Private Member Functions | |
static | isNotUnittest ($table) |
static | unprefixTable ($tableName) |
Private Attributes | |
$called = array() | |
$called tracks whether the setUp and tearDown method has been called. | |
array | $mwGlobals = array() |
Holds original values of MediaWiki configuration settings to be restored in tearDown(). | |
array | $tmpfiles = array() |
Holds the paths of temporary files/directories created through getNewTempFile, and getNewTempDirectory. | |
Static Private Attributes | |
static | $dbSetup = false |
static | $oldTablePrefix = false |
static | $reuseDB = false |
static | $useTemporaryTables = true |
Definition at line 3 of file MediaWikiTestCase.php.
MediaWikiTestCase::__construct | ( | $ | name = null , |
array $ | data = array() , |
||
$ | dataName = '' |
||
) |
Reimplemented in RevisionStorageTest, WikiPageTest, JobQueueTest, and LinksUpdateTest.
Definition at line 64 of file MediaWikiTestCase.php.
Referenced by RevisionTestModifyableContent\__construct(), and RevisionTestModifyableContentHandler\__construct().
MediaWikiTestCase::__call | ( | $ | func, |
$ | args | ||
) |
Reimplemented in MWNamespaceTest.
Definition at line 501 of file MediaWikiTestCase.php.
MediaWikiTestCase::addCoreDBData | ( | ) | [private] |
Definition at line 353 of file MediaWikiTestCase.php.
Stub.
If a test needs to add additional data to the database, it should implement this method and do so
Reimplemented in NewParserTest, FetchTextTest, BackupDumperLoggerTest, SearchEngineTest, ApiQueryBasicTest, ApiQueryContinueTest, ApiQueryContinue2Test, MessageCacheTest, TextPassDumperTest, BlockTest, BackupDumperPageTest, ApiBlockTest, and GenderCacheTest.
Definition at line 350 of file MediaWikiTestCase.php.
MediaWikiTestCase::arrayWrap | ( | array $ | elements | ) | [protected] |
Utility method taking an array of elements and wrapping each element in it's own array.
Useful for data providers that only return a single argument.
array | $elements |
Definition at line 648 of file MediaWikiTestCase.php.
Referenced by SiteTest\instanceProvider(), GenericArrayObjectTest\instanceProvider(), SiteListTest\siteArrayProvider(), and SiteListTest\siteListProvider().
MediaWikiTestCase::assertArrayEquals | ( | array $ | expected, |
array $ | actual, | ||
$ | ordered = false , |
||
$ | named = false |
||
) | [protected] |
Assert that two arrays are equal.
By default this means that both arrays need to hold the same set of values. Using additional arguments, order and associated key can also be set as relevant.
array | $expected | |
array | $actual | |
boolean | $ordered | If the order of the values should match |
boolean | $named | If the keys should match |
Definition at line 669 of file MediaWikiTestCase.php.
Referenced by SiteListTest\testGetGlobalIdentifiers(), TextContentTest\testGetParserOutput(), SiteListTest\testSerialization(), GenericArrayObjectTest\testSerialization(), UIDGeneratorTest\testTimestampedUID(), and LinksUpdateTest\testUpdate_pagelinks().
MediaWikiTestCase::assertEmpty2 | ( | $ | value, |
$ | msg | ||
) | [private] |
Definition at line 519 of file MediaWikiTestCase.php.
MediaWikiTestCase::assertException | ( | $ | code, |
$ | expected = 'Exception' , |
||
$ | message = '' |
||
) | [protected] |
Asserts that an exception of the specified type occurs when running the provided code.
callable | $code | |
string | $expected | |
string | $message |
Definition at line 930 of file MediaWikiTestCase.php.
MediaWikiTestCase::assertHTMLEquals | ( | $ | expected, |
$ | actual, | ||
$ | msg = '' |
||
) | [protected] |
Put each HTML element on its own line and then equals() the results.
Use for nicely formatting of PHPUnit diff output when comparing very simple HTML
String | $expected | HTML on oneline |
String | $actual | HTML on oneline |
String | $msg | Optional message |
Definition at line 698 of file MediaWikiTestCase.php.
MediaWikiTestCase::assertSelect | ( | $ | table, |
$ | fields, | ||
$ | condition, | ||
array $ | expectedRows | ||
) | [protected] |
Asserts that the given database query yields the rows given by $expectedRows.
The expected rows should be given as indexed (not associative) arrays, with the values given in the order of the columns in the $fields parameter. Note that the rows are sorted by the columns given in $fields.
$table | String|Array the table(s) to query |
$fields | String|Array the columns to include in the result (and to sort by) |
$condition | String|Array "where" condition(s) |
$expectedRows | Array - an array of arrays giving the expected rows. |
MWException | if this test cases's needsDB() method doesn't return true. Test cases can use "@group Database" to enable database test support, or list the tables under testing in $this->tablesUsed, or override the needsDB() method. |
Definition at line 608 of file MediaWikiTestCase.php.
Referenced by LinksUpdateTest\assertLinksUpdate().
MediaWikiTestCase::assertType | ( | $ | type, |
$ | actual, | ||
$ | message = '' |
||
) | [protected] |
Asserts the type of the provided value.
This can be either in internal type such as boolean or integer, or a class or interface the value extends or implements.
string | $type | |
mixed | $actual | |
string | $message |
Definition at line 774 of file MediaWikiTestCase.php.
Referenced by ApiQueryTestBase\validateRequestExpectedPair().
MediaWikiTestCase::assertTypeOrValue | ( | $ | type, |
$ | actual, | ||
$ | value = false , |
||
$ | message = '' |
||
) | [protected] |
Asserts that the provided variable is of the specified internal type or equals the $value argument.
This is useful for testing return types of functions that return a certain type or *value* when not set or on error.
string | $type | |
mixed | $actual | |
mixed | $value | |
string | $message |
Definition at line 755 of file MediaWikiTestCase.php.
Referenced by SiteTest\testGetGlobalId(), SiteTest\testGetLanguageCode(), and SiteTest\testGetPath().
MediaWikiTestCase::checkDbIsSupported | ( | ) | [protected] |
Definition at line 560 of file MediaWikiTestCase.php.
MediaWikiTestCase::checkHasDiff3 | ( | ) | [protected] |
Check, if $wgDiff3 is set and ready to merge Will mark the calling test as skipped, if not ready.
Definition at line 864 of file MediaWikiTestCase.php.
Referenced by EditPageTest\testAutoMerge(), and GlobalTest\testMerge().
MediaWikiTestCase::checkHasGzip | ( | ) | [protected] |
Check whether we have the 'gzip' commandline utility, will skip the test whenever "gzip -V" fails.
Result is cached at the process level.
Definition at line 888 of file MediaWikiTestCase.php.
Referenced by TextPassDumperTest\testCheckpointGzip(), BackupDumperPageTest\testCurrentStubGzip(), BackupDumperPageTest\testXmlDumpsBackupUseCase(), and BackupDumperLoggerTest\testXmlDumpsBackupUseCaseLogging().
MediaWikiTestCase::checkPHPExtension | ( | $ | extName | ) | [protected] |
Check if $extName is a loaded PHP extension, will skip the test whenever it is not loaded.
Definition at line 910 of file MediaWikiTestCase.php.
Referenced by RevisionTest\testCompressRevisionTextUtf8Gzip(), RevisionTest\testGetRevisionTextGzip(), RevisionTest\testGetRevisionTextUtf8LegacyGzip(), RevisionTest\testGetRevisionTextUtf8NativeGzip(), and PNGMetadataExtractorTest\testPngNativetZtxt().
Definition at line 327 of file MediaWikiTestCase.php.
Referenced by DatabaseTest\prefixAndQuote().
MediaWikiTestCase::getCliArg | ( | $ | offset | ) |
Definition at line 566 of file MediaWikiTestCase.php.
Referenced by BagOStuffTest\setUp(), StoreBatchTest\setUp(), JobQueueTest\setUp(), NewParserTest\setUp(), NewParserTest\setupGlobals(), NewParserTest\testFuzzTests(), and BagOStuffTest\testMerge().
MediaWikiTestCase::getDefaultWikitextNS | ( | ) | [protected] |
Returns the ID of a namespace that defaults to Wikitext.
Throws an MWException if there is none.
Definition at line 808 of file MediaWikiTestCase.php.
Referenced by TextPassDumperTest\addDBData(), EditPageTest\assertEdit(), RevisionStorageTest\createPage(), WikiPageTest\newPage(), EditPageTest\testAutoMerge(), TextContentTest\testDeletionUpdates(), and WikitextContentTest\testGetSecondaryDataUpdates().
MediaWikiTestCase::getNewTempDirectory | ( | ) | [protected] |
obtains a new temporary directory
The obtained directory is enlisted to be removed (recursively with all its contained files) upon tearDown.
Definition at line 149 of file MediaWikiTestCase.php.
Referenced by TextPassDumperTest\checkpointHelper(), and ExifRotationTest\setUp().
MediaWikiTestCase::getNewTempFile | ( | ) | [protected] |
obtains a new temporary file name
The obtained filename is enlisted to be removed upon tearDown
Definition at line 134 of file MediaWikiTestCase.php.
Referenced by TextPassDumperTest\checkpointHelper(), TextPassDumperTest\setUpStub(), CdbTest\testCdb(), BackupDumperPageTest\testCurrentStubGzip(), BackupDumperPageTest\testCurrentStubPlain(), BackupDumperPageTest\testFullStubPlain(), BackupDumperPageTest\testFullTextPlain(), TextPassDumperTest\testPlain(), BackupDumperLoggerTest\testPlain(), TextPassDumperTest\testPrefetchPlain(), GlobalTest\testWfMkdirParents(), BackupDumperPageTest\testXmlDumpsBackupUseCase(), and BackupDumperLoggerTest\testXmlDumpsBackupUseCaseLogging().
MediaWikiTestCase::hideDeprecated | ( | $ | function | ) |
Don't throw a warning if $function is deprecated and called later.
$function | String |
Definition at line 584 of file MediaWikiTestCase.php.
Referenced by BlockTest\testBug29116LoadWithEmptyIp(), RevisionTest\testConstructWithContent(), RevisionTest\testConstructWithText(), WikiPageTest\testDoEdit(), WikiPageTest\testDoQuickEdit(), RevisionTest\testGetRawText(), WikiPageTest\testGetRawText(), RevisionTest\testGetText(), and WikiPageTest\testGetText().
static MediaWikiTestCase::isNotUnittest | ( | $ | table | ) | [static, private] |
Definition at line 529 of file MediaWikiTestCase.php.
MediaWikiTestCase::isWikitextNS | ( | $ | ns | ) | [protected] |
Returns true if the given namespace defaults to Wikitext according to $wgNamespaceContentModels.
int | $ns | The namespace ID to check |
Definition at line 791 of file MediaWikiTestCase.php.
Referenced by SearchEngineTest\addDBData(), SearchEngineTest\fetchIds(), and NewParserTest\testParserTest().
static MediaWikiTestCase::listTables | ( | $ | db | ) | [static] |
Definition at line 533 of file MediaWikiTestCase.php.
MediaWikiTestCase::mergeMwGlobalArrayValue | ( | $ | name, |
$ | values | ||
) | [protected] |
Merges the given values into a MW global array variable.
Useful for setting some entries in a configuration array, instead of setting the entire array.
String | $name | The name of the global, as in wgFooBar |
Array | $values | The array containing the entries to set in that global |
MWException | if the designated global is not an array. |
Definition at line 309 of file MediaWikiTestCase.php.
Referenced by RevisionTest\setUp(), and TitleMethodsTest\setUp().
Definition at line 331 of file MediaWikiTestCase.php.
MediaWikiTestCase::objectAssociativeSort | ( | array &$ | array | ) | [protected] |
Does an associative sort that works for objects.
array | $array |
Definition at line 712 of file MediaWikiTestCase.php.
MediaWikiTestCase::resetDB | ( | ) | [private] |
Empty all tables so they can be repopulated for tests.
Definition at line 476 of file MediaWikiTestCase.php.
MediaWikiTestCase::run | ( | PHPUnit_Framework_TestResult $ | result = null | ) |
Definition at line 71 of file MediaWikiTestCase.php.
Referenced by HooksTest\testFalseReturn(), HooksTest\testFatalError(), HooksTest\testNewStyleHookInteraction(), HooksTest\testNewStyleHooks(), and HooksTest\testUncallableFunction().
MediaWikiTestCase::setCliArg | ( | $ | offset, |
$ | value | ||
) |
Definition at line 573 of file MediaWikiTestCase.php.
MediaWikiTestCase::setMwGlobals | ( | $ | pairs, |
$ | value = null |
||
) | [protected] |
Definition at line 279 of file MediaWikiTestCase.php.
Referenced by BackupDumperPageTest\addDBData(), EditPageTest\assertEdit(), MessageCacheTest\configureLanguages(), BitmapMetadataHandlerTest\setUp(), GlobalTest\setUp(), MessageTest\setUp(), BitmapScalingTest\setUp(), ExifTest\setUp(), HtmlTest\setUp(), JpegTest\setUp(), TiffTest\setUp(), LanguageConverterTest\setUp(), ResourceLoaderTest\setUp(), RevisionTest\setUp(), XmlTest\setUp(), ExtraParserTest\setUp(), MediaWikiLangTestCase\setUp(), TestSample\setUp(), TitleTest\setUp(), ExifBitmapTest\setUp(), ApiCreateAccountTest\setUp(), UploadFromUrlTest\setUp(), WikiPageTest_ContentHandlerUseDB\setUp(), CSSMinTest\setUp(), ApiTestCase\setUp(), RevisionTest_ContentHandlerUseDB\setUp(), CssContentTest\setUp(), LocalFileTest\setUp(), ExifRotationTest\setUp(), FormatMetadataTest\setUp(), ApiTestCaseUpload\setUp(), TextContentTest\setUp(), XmlSelectTest\setUp(), ContentHandlerTest\setUp(), MWNamespaceTest\setUp(), BlockTest\setUp(), UserTest\setUp(), TagHookTest\setUp(), JobQueueTest\setUp(), SearchUpdateTest\setUp(), WfParseUrlTest\setUp(), NewParserTest\setUp(), UploadStashTest\testBug29408(), SpecialPreferencesTest\testBug41337(), ExtraParserTest\testCleanSigDisabled(), RevisionTest\testCompressRevisionTextUtf8Gzip(), HtmlTest\testElementBasics(), ExternalStoreTest\testExternalFetchFromURL(), ContentHandlerTest\testGetContentText_NonTextContent_fail(), ContentHandlerTest\testGetContentText_NonTextContent_ignore(), ContentHandlerTest\testGetContentText_NonTextContent_serialize(), ContentHandlerTest\testGetContentText_Null(), ContentHandlerTest\testGetContentText_TextContent(), WebRequestTest\testGetIP(), MessageTest\testInContentLanguageDisabled(), MessageTest\testInContentLanguageEnabled(), TextContentTest\testIsCountable(), WikiPageTest\testIsCountable(), ExifRotationTest\testMetadataNoAutoRotate(), BitmapMetadataHandlerTest\testMultilingualCascade(), SanitizerTest\testRemovehtmltagsOnHtml5Tags(), ExifRotationTest\testRotationRenderingNoAutoRotate(), LinksUpdateTest\testUpdate_categorylinks(), ApiUploadTest\testUploadChunks(), ApiUploadTest\testUploadStash(), TimeAdjustTest\testUserAdjust(), LinkerTest\testUserLink(), and WfExpandUrlTest\testWfExpandUrl().
MediaWikiTestCase::setUp | ( | ) | [protected] |
setUp and tearDown should (where significant) happen in reverse order.
Reimplemented in FetchTextTest, MaintenanceTest, TextPassDumperTest, BackupDumperPageTest, DumpTestCase, TestORMRowTest, LanguageClassesTestCase, FormOptionsInitializationTest, NewParserTest, SideBarTest, RevisionStorageTest, DatabaseSqliteTest, WikiPageTest, MagicVariableTest, PreferencesTest, SiteConfigurationTest, FormOptionsTest, FauxResponseTest, LinksUpdateTest, WfParseUrlTest, SearchUpdateTest, TitlePermissionTest, LogFormatterTest, JobQueueTest, ParserPreloadTest, ApiOptionsTest, FileBackendTest, TagHookTest, ApiEditPageTest, BlockTest, JpegMetadataExtractorTest, MWNamespaceTest, PathRouterTest, SearchEngineTest, UserTest, ArticleTest, ContentHandlerTest, DatabaseSQLTest, DatabaseTest, StoreBatchTest, PreprocessorTest, WikitextContentHandlerTest, TitleMethodsTest, XmlSelectTest, ApiTestCaseUpload, TextContentTest, ExifRotationTest, FormatMetadataTest, UploadStashTest, ZipDirectoryReaderTest, ApiParseTest, ApiPurgeTest, ApiTestCase, ApiWatchTest, ApiQueryTest, MessageCacheTest, CssContentTest, CSSMinTest, LocalFileTest, BagOStuffTest, RevisionTest_ContentHandlerUseDB, UploadBaseTest, WikiPageTest_ContentHandlerUseDB, ApiCreateAccountTest, ApiBlockTest, GenderCacheTest, ExifBitmapTest, GIFHandlerTest, PNGHandlerTest, SanitizerTest, UploadFromUrlTest, WebRequestTest, CdbTest, ExtraParserTest, PNGMetadataExtractorTest, SVGMetadataExtractorTest, XMPTest, TestSample, TimestampTest, TitleTest, XmlTest, MediaWikiLangTestCase, LanguageConverterTest, JpegTest, TiffTest, TidyTest, ResourceLoaderTest, RevisionTest, MWDebugTest, HtmlTest, ExifTest, HooksTest, BitmapScalingTest, DiffHistoryBlobTest, GlobalTest, BitmapMetadataHandlerTest, GIFMetadataExtractorTest, MessageTest, TimeAdjustTest, and CollationTest.
Definition at line 167 of file MediaWikiTestCase.php.
static MediaWikiTestCase::setupTestDB | ( | DatabaseBase $ | db, |
$ | prefix | ||
) | [static] |
Creates an empty skeleton of the wiki database by cloning its structure to equivalent tables using the given $prefix.
Then sets MediaWiki to use the new set of tables (aka schema) instead of the original set.
This is used to generate a dummy table set, typically consisting of temporary tables, that will be used by tests instead of the original wiki database tables.
DatabaseBase | $db | The database connection |
String | $prefix | The prefix to use for the new table set (aka schema). |
MWException | if the database table prefix is already $prefix |
Definition at line 443 of file MediaWikiTestCase.php.
static MediaWikiTestCase::stripStringKeys | ( | &$ | r | ) | [static, protected] |
Utility function for eliminating all string keys from an array.
Useful to turn a database result row as returned by fetchRow() into a pure indexed array.
$r | mixed the array to remove string keys from. |
Definition at line 730 of file MediaWikiTestCase.php.
MediaWikiTestCase::tearDown | ( | ) | [protected] |
Reimplemented in NewParserTest, MaintenanceTest, TestORMRowTest, LanguageClassesTestCase, RevisionStorageTest, JobQueueTest, ApiOptionsTest, StoreBatchTest, RevisionTest, LogFormatterTest, WikiPageTest, ContentHandlerTest, TitleMethodsTest, UploadStashTest, SearchEngineTest, ApiEditPageTest, ParserPreloadTest, LanguageConverterTest, BagOStuffTest, TestSample, ApiTestCaseUpload, GlobalTest, UploadBaseTest, ArticleTest, XmlSelectTest, MWDebugTest, DatabaseTest, BaseDumpTest, and WebRequestTest.
Definition at line 205 of file MediaWikiTestCase.php.
static MediaWikiTestCase::teardownTestDB | ( | ) | [static] |
Restores MediaWiki to using the table set (table prefix) it was using before setupTestDB() was called.
Useful if we need to perform database operations after the test run has finished (such as saving logs or profiling info).
Definition at line 413 of file MediaWikiTestCase.php.
Make sure MediaWikiTestCase extending classes have called their parent setUp method.
Definition at line 241 of file MediaWikiTestCase.php.
static MediaWikiTestCase::unprefixTable | ( | $ | tableName | ) | [static, private] |
Definition at line 523 of file MediaWikiTestCase.php.
Definition at line 123 of file MediaWikiTestCase.php.
MediaWikiTestCase::$called = array() [private] |
$called tracks whether the setUp and tearDown method has been called.
class extending MediaWikiTestCase usually override setUp and tearDown but forget to call the parent.
The array format takes a method name as key and anything as a value. By asserting the key exist, we know the child class has called the parent.
This property must be private, we do not want child to override it, they should call the appropriate parent method instead.
Definition at line 20 of file MediaWikiTestCase.php.
Referenced by HtmlCheckMatrixTest\testValidateCallsUserDefinedValidationCallback().
DatabaseBase MediaWikiTestCase::$db [protected] |
Reimplemented in DatabaseSqliteTest, and DatabaseTest.
Definition at line 29 of file MediaWikiTestCase.php.
Referenced by DatabaseMysqlBaseTest\getMockForViews(), DatabaseMysqlBaseTest\testAddIdentifierQuotes(), ORMTableTest\testIgnoreErrorsOverride(), DatabaseMysqlBaseTest\testIsView(), and DatabaseMysqlBaseTest\testListviews().
MediaWikiTestCase::$dbSetup = false [static, private] |
Definition at line 34 of file MediaWikiTestCase.php.
Holds original values of MediaWiki configuration settings to be restored in tearDown().
See also setMwGlobal().
Definition at line 49 of file MediaWikiTestCase.php.
MediaWikiTestCase::$oldTablePrefix = false [static, private] |
Definition at line 35 of file MediaWikiTestCase.php.
MediaWikiTestCase::$regex = '' |
Reimplemented in NewParserTest.
Definition at line 5 of file MediaWikiTestCase.php.
MediaWikiTestCase::$reuseDB = false [static, private] |
Definition at line 33 of file MediaWikiTestCase.php.
MediaWikiTestCase::$runDisabled = false |
Reimplemented in NewParserTest.
Definition at line 6 of file MediaWikiTestCase.php.
MediaWikiTestCase::$suite |
Definition at line 4 of file MediaWikiTestCase.php.
MediaWikiTestCase::$supportedDBs [protected] |
array( 'mysql', 'sqlite', 'postgres', 'oracle' )
Definition at line 57 of file MediaWikiTestCase.php.
MediaWikiTestCase::$tablesUsed = array() [protected] |
Definition at line 30 of file MediaWikiTestCase.php.
Holds the paths of temporary files/directories created through getNewTempFile, and getNewTempDirectory.
Definition at line 42 of file MediaWikiTestCase.php.
MediaWikiTestCase::$users [static] |
Reimplemented in UploadStashTest.
Definition at line 25 of file MediaWikiTestCase.php.
MediaWikiTestCase::$useTemporaryTables = true [static, private] |
Definition at line 32 of file MediaWikiTestCase.php.
const MediaWikiTestCase::DB_PREFIX = 'unittest_' |
const MediaWikiTestCase::ORA_DB_PREFIX = 'ut_' |
Definition at line 55 of file MediaWikiTestCase.php.