MediaWiki  REL1_19
MediaWikiTestCase Class Reference

Inherited by ArticleTest, BitmapMetadataHandlerTest, BitmapScalingTest, CdbTest, CleanUpTest, DatabaseSqliteTest, DatabaseTest, DummyExtensionsTest, EditPageTest, ExifBitmapTest, ExifRotationTest, ExifTest, ExternalStoreTest, ExtraParserTest, FauxResponseTest, FileBackendTest, FileRepoTest, FormatMetadataTest, FormOptionsInitializationTest, FormOptionsTest, GIFHandlerTest, GIFMetadataExtractorTest, GlobalTest, GlobalWithDBTest, HooksTest, HtmlTest, HttpTest, IEUrlExtensionTest, InstallDocFormatterTest, IPTCTest, IPTest, JavaScriptMinifierTest, JpegMetadataExtractorTest, JpegTest, JsonTest, LanguageAmTest, LanguageArTest, LanguageBeTaraskTest, LanguageBeTest, LanguageBhTest, LanguageBsTest, LanguageCsTest, LanguageCuTest, LanguageCyTest, LanguageDsbTest, LanguageFrTest, LanguageGaTest, LanguageGdTest, LanguageGvTest, LanguageHeTest, LanguageHiTest, LanguageHrTest, LanguageHsbTest, LanguageHyTest, LanguageKshTest, LanguageLnTest, LanguageLtTest, LanguageLvTest, LanguageMgTest, LanguageMkTest, LanguageMlTest, LanguageMoTest, LanguageMtTest, LanguageNlTest, LanguageNsoTest, LanguagePlTest, LanguageRoTest, LanguageRuTest, LanguageSeTest, LanguageSgsTest, LanguageShTest, LanguageSkTest, LanguageSlTest, LanguageSmaTest, LanguageSrTest, LanguageTest, LanguageTiTest, LanguageTlTest, LanguageTrTest, LanguageUkTest, LanguageWaTest, LicensesTest, LocalFileTest, MagicVariableTest, MediaHandlerTest, MediaWikiLangTestCase, MWDebugTest, MWFunctionTest, MWNamespaceTest, NewParserTest, ParserOptionsTest, ParserPreloadTest, PathRouterTest, PNGHandlerTest, PNGMetadataExtractorTest, PreprocessorTest, QueryAllSpecialPagesTest, ResourceLoaderTest, RevisionTest, SanitizerTest, SanitizerValidateEmailTest, SearchEngineTest, SearchUpdateTest, SeleniumConfigurationTest, ServicesJsonTest, SiteConfigurationTest, SpecialRecentchangesTest, SpecialSearchTest, StoreBatchTest, StructureTest, SVGMetadataExtractorTest, TagHookTest, TiffTest, TitleMethodsTest, TitleTest, UploadStashTest, UploadTest, UserTest, WebRequestTest, wfAssembleUrl, wfBaseName, wfBCP47, wfExpandUrl, wfRemoveDotSegments, wfShorthandToIntegerTest, wfTimestamp, wfUrlencodeTest, XmlJs, XmlSelectTest, XmlTest, XMPTest, XMPValidateTest, and ZipDirectoryReaderTest.

List of all members.

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)

Static Public Member Functions

static disableInterwikis ($prefix, &$data)

Public Attributes

 $regex = ''
 $runDisabled = false
 $suite
const DB_PREFIX = 'unittest_'
 Table name prefixes.
const ORA_DB_PREFIX = 'ut_'

Protected Member Functions

 checkDbIsSupported ()
 listTables ()

Protected Attributes

 $db
 $oldTablePrefix
 $reuseDB = false
 $supportedDBs
 $tablesUsed = array()
 $useTemporaryTables = true

Private Member Functions

 addCoreDBData ()
 assertEmpty2 ($value, $msg)
 initDB ()
 resetDB ()
 Empty all tables so they can be repopulated for tests.

Static Private Member Functions

static isNotUnittest ($table)
static unprefixTable ($tableName)

Static Private Attributes

static $dbSetup = false

Detailed Description

Definition at line 3 of file MediaWikiTestCase.php.


Constructor & Destructor Documentation

MediaWikiTestCase::__construct ( name = null,
array $  data = array(),
dataName = '' 
)

Definition at line 32 of file MediaWikiTestCase.php.


Member Function Documentation

MediaWikiTestCase::__call ( func,
args 
)

Reimplemented in MWNamespaceTest.

Definition at line 192 of file MediaWikiTestCase.php.

Definition at line 89 of file MediaWikiTestCase.php.

References $page, $user, WikiPage\factory(), User\newFromName(), Title\newFromText(), and User\resetIdByNameCache().

Referenced by run().

Here is the call graph for this function:

Here is the caller graph for this function:

Stub.

If a test needs to add additional data to the database, it should implement this method and do so

Reimplemented in NewParserTest, SearchEngineTest, BlockTest, and ApiBlockTest.

Definition at line 87 of file MediaWikiTestCase.php.

Referenced by run().

Here is the caller graph for this function:

MediaWikiTestCase::assertEmpty2 ( value,
msg 
) [private]

Definition at line 210 of file MediaWikiTestCase.php.

Definition at line 243 of file MediaWikiTestCase.php.

Referenced by run().

Here is the caller graph for this function:

Definition at line 74 of file MediaWikiTestCase.php.

References DB_PREFIX.

Referenced by initDB(), and DatabaseTest\prefixAndQuote().

Here is the caller graph for this function:

static MediaWikiTestCase::disableInterwikis ( prefix,
&$  data 
) [static]

Definition at line 263 of file MediaWikiTestCase.php.

Definition at line 249 of file MediaWikiTestCase.php.

Referenced by run(), StoreBatchTest\setUp(), FileBackendTest\setUp(), NewParserTest\setUp(), NewParserTest\setupGlobals(), and NewParserTest\testFuzzTests().

Here is the caller graph for this function:

Don't throw a warning if $function is deprecated and called later.

Parameters:
$functionString
Returns:
null

Definition at line 273 of file MediaWikiTestCase.php.

References wfDeprecated(), wfRestoreWarnings(), and wfSuppressWarnings().

Referenced by BlockTest\testBug29116LoadWithEmptyIp().

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 145 of file MediaWikiTestCase.php.

References $wgDBprefix, CloneDatabase\changePrefix(), dbPrefix(), listTables(), and resetDB().

Referenced by run().

Here is the call graph for this function:

Here is the caller graph for this function:

static MediaWikiTestCase::isNotUnittest ( table) [static, private]

Definition at line 219 of file MediaWikiTestCase.php.

Definition at line 223 of file MediaWikiTestCase.php.

References $wgDBprefix.

Referenced by initDB().

Here is the caller graph for this function:

Definition at line 78 of file MediaWikiTestCase.php.

Referenced by run().

Here is the caller graph for this function:

Empty all tables so they can be repopulated for tests.

Definition at line 171 of file MediaWikiTestCase.php.

References wfGetDB(), and wfGetLB().

Referenced by initDB(), and run().

Here is the call graph for this function:

Here is the caller graph for this function:

MediaWikiTestCase::run ( PHPUnit_Framework_TestResult $  result = NULL)

Definition at line 39 of file MediaWikiTestCase.php.

References ObjectCache\$instances, $result, $wgDBprefix, addCoreDBData(), addDBData(), checkDbIsSupported(), getCliArg(), initDB(), needsDB(), resetDB(), and wfGetDB().

Referenced by HooksTest\testNewStyleHooks().

Here is the call graph for this function:

Here is the caller graph for this function:

MediaWikiTestCase::setCliArg ( offset,
value 
)

Definition at line 257 of file MediaWikiTestCase.php.

static MediaWikiTestCase::unprefixTable ( tableName) [static, private]

Definition at line 214 of file MediaWikiTestCase.php.

References $wgDBprefix.


Member Data Documentation

MediaWikiTestCase::$db [protected]

Reimplemented in DatabaseSqliteTest, and DatabaseTest.

Definition at line 11 of file MediaWikiTestCase.php.

MediaWikiTestCase::$dbSetup = false [static, private]

Definition at line 17 of file MediaWikiTestCase.php.

MediaWikiTestCase::$oldTablePrefix [protected]

Definition at line 12 of file MediaWikiTestCase.php.

MediaWikiTestCase::$regex = ''

Reimplemented in NewParserTest.

Definition at line 5 of file MediaWikiTestCase.php.

MediaWikiTestCase::$reuseDB = false [protected]

Definition at line 14 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]
Initial value:
 array(
                'mysql',
                'sqlite',
                'postgres',
                'oracle'
        )

Definition at line 25 of file MediaWikiTestCase.php.

MediaWikiTestCase::$tablesUsed = array() [protected]

Definition at line 15 of file MediaWikiTestCase.php.

MediaWikiTestCase::$useTemporaryTables = true [protected]

Definition at line 13 of file MediaWikiTestCase.php.

const MediaWikiTestCase::DB_PREFIX = 'unittest_'

Table name prefixes.

Oracle likes it shorter.

Definition at line 22 of file MediaWikiTestCase.php.

Referenced by dbPrefix().

Definition at line 23 of file MediaWikiTestCase.php.


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