MediaWiki  REL1_24
NewParserTest Class Reference

Although marked as a stub, can work independently. More...

Inheritance diagram for NewParserTest:
Collaboration diagram for NewParserTest:

List of all members.

Public Member Functions

 addArticle ($name, $text, $line)
 addDBData ()
 Stub.
 getFuzzInput ($filenames)
 Get an input dictionary from a set of parser test files.
 getMemoryBreakdown ()
 Get a memory usage breakdown.
 getParser ($preprocessor=null)
 Get a Parser object.
 parserTestProvider ()
 publishTestArticles ()
 removeEndingNewline ($s)
 Remove last character if it is a newline.
 requireFunctionHook ($name)
 requireHook ($name)
 Steal a callback function from the primary parser, save it for application to our scary parser.
 requireTransparentHook ($name)
 setParserTestFile ($filename)
 Set the file from whose tests will be run by this instance.
 testFuzzTests ()
 Run a fuzz test series Draw input from a set of test files.
 testParserTest ($desc, $input, $result, $opts, $config)
 medium parserTestProvider

Static Public Member Functions

static setUpBeforeClass ()
static tearDownAfterClass ()

Public Attributes

 $functionHooks = array()
 $fuzzSeed = 0
 $hooks = array()
 $keepUploads = false
 $maxFuzzTestLength = 300
 $memoryLimit = 50
 $regex = ''
 $runDisabled = false
 $runParsoid = false
 $savedGlobals = array()
 $savedWeirdGlobals = array()
 $showProgress = true
 $transparentHooks = array()

Protected Member Functions

 cleanupOption ($opt)
 getBaseDir ()
 getUploadDir ()
 Get an FS upload directory (only applies to FSFileBackend)
 parseOptions ($instring)
 setUp ()
 setupGlobals ($opts=array(), $config= '')
 Set up the global variables for a consistent environment for each test.
 setupUploads ()
 Create a dummy uploads directory which will contain a couple of files in order to pass existence tests.
 tearDown ()
 teardownGlobals ()
 Restore default values and perform any necessary clean-up after each test runs.

Static Protected Member Functions

static getOptionValue ($key, $opts, $default)
 Use a regex to find out the value of an option.

Protected Attributes

 $file = false

Static Protected Attributes

static $articles = array()
static $backendToUse

Private Member Functions

 teardownUploads ()
 Remove the dummy uploads directory.

Static Private Member Functions

static deleteFiles ($files)
 Delete the specified files, if they exist.

Private Attributes

DjVuSupport $djVuSupport
TidySupport $tidySupport

Detailed Description

Although marked as a stub, can work independently.

Database Parser Stub

Todo:
covers tags

Definition at line 12 of file NewParserTest.php.


Member Function Documentation

NewParserTest::addArticle ( name,
text,
line 
)

Definition at line 947 of file NewParserTest.php.

References $name, and array().

Stub.

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

Since:
1.18

Reimplemented from MediaWikiTestCase.

Definition at line 210 of file NewParserTest.php.

NewParserTest::cleanupOption ( opt) [protected]

Definition at line 1061 of file NewParserTest.php.

Referenced by parseOptions().

static NewParserTest::deleteFiles ( files) [static, private]

Delete the specified files, if they exist.

Parameters:
array$filesFull paths to files to delete.

Definition at line 635 of file NewParserTest.php.

NewParserTest::getBaseDir ( ) [protected]

Definition at line 650 of file NewParserTest.php.

NewParserTest::getFuzzInput ( filenames)

Get an input dictionary from a set of parser test files.

Parameters:
array$filenames
Returns:
string

Definition at line 878 of file NewParserTest.php.

Get a memory usage breakdown.

Returns:
array

Definition at line 897 of file NewParserTest.php.

static NewParserTest::getOptionValue ( key,
opts,
default 
) [static, protected]

Use a regex to find out the value of an option.

Parameters:
string$keyName of option val to retrieve
array$optsOptions array to look in
mixed$defaultDefault value returned if not found
Returns:
mixed

Definition at line 1080 of file NewParserTest.php.

NewParserTest::getParser ( preprocessor = null)

Get a Parser object.

Parameters:
Preprocessor$preprocessor
Returns:
Parser

Definition at line 934 of file NewParserTest.php.

NewParserTest::getUploadDir ( ) [protected]

Get an FS upload directory (only applies to FSFileBackend)

Returns:
string The directory

Definition at line 479 of file NewParserTest.php.

NewParserTest::parseOptions ( instring) [protected]

Definition at line 1005 of file NewParserTest.php.

References $key, $matches, $regex, array(), as, and cleanupOption().

Definition at line 654 of file NewParserTest.php.

Definition at line 951 of file NewParserTest.php.

Remove last character if it is a newline.

Parameters:
string$s
Returns:
string

Definition at line 995 of file NewParserTest.php.

Definition at line 976 of file NewParserTest.php.

Steal a callback function from the primary parser, save it for application to our scary parser.

If the hook is not installed, abort processing of this file.

Parameters:
string$name
Returns:
bool True if tag hook is present

Definition at line 970 of file NewParserTest.php.

Definition at line 982 of file NewParserTest.php.

Set the file from whose tests will be run by this instance.

Parameters:
string$filename

Definition at line 667 of file NewParserTest.php.

NewParserTest::setUp ( ) [protected]

Reimplemented from MediaWikiTestCase.

Definition at line 49 of file NewParserTest.php.

static NewParserTest::setUpBeforeClass ( ) [static]

Definition at line 44 of file NewParserTest.php.

References ParserTest\setupInterwikis().

NewParserTest::setupGlobals ( opts = array(),
config = '' 
) [protected]

Set up the global variables for a consistent environment for each test.

Ideally this should replace the global configuration entirely.

Parameters:
array$opts
string$config
Returns:
RequestContext

Definition at line 358 of file NewParserTest.php.

NewParserTest::setupUploads ( ) [protected]

Create a dummy uploads directory which will contain a couple of files in order to pass existence tests.

Returns:
string The directory

Definition at line 506 of file NewParserTest.php.

static NewParserTest::tearDownAfterClass ( ) [static]

Definition at line 205 of file NewParserTest.php.

References ParserTest\tearDownInterwikis().

Restore default values and perform any necessary clean-up after each test runs.

Definition at line 547 of file NewParserTest.php.

Remove the dummy uploads directory.

Definition at line 558 of file NewParserTest.php.

Run a fuzz test series Draw input from a set of test files.

Todo:
fixme Needs some work to not eat memory until the world explodes

ParserFuzz

Definition at line 799 of file NewParserTest.php.

NewParserTest::testParserTest ( desc,
input,
result,
opts,
config 
)

medium parserTestProvider

Parameters:
string$desc
string$input
string$result
array$opts
array$config

Definition at line 680 of file NewParserTest.php.


Member Data Documentation

NewParserTest::$articles = array() [static, protected]

Definition at line 13 of file NewParserTest.php.

NewParserTest::$backendToUse [static, protected]

Definition at line 17 of file NewParserTest.php.

DjVuSupport NewParserTest::$djVuSupport [private]

Definition at line 37 of file NewParserTest.php.

NewParserTest::$file = false [protected]

Definition at line 42 of file NewParserTest.php.

NewParserTest::$functionHooks = array()

Definition at line 27 of file NewParserTest.php.

NewParserTest::$fuzzSeed = 0

Definition at line 32 of file NewParserTest.php.

NewParserTest::$hooks = array()

Definition at line 26 of file NewParserTest.php.

NewParserTest::$keepUploads = false

Definition at line 19 of file NewParserTest.php.

NewParserTest::$maxFuzzTestLength = 300

Definition at line 31 of file NewParserTest.php.

NewParserTest::$memoryLimit = 50

Definition at line 33 of file NewParserTest.php.

NewParserTest::$regex = ''

Definition at line 22 of file NewParserTest.php.

Referenced by parseOptions().

NewParserTest::$runDisabled = false

Definition at line 20 of file NewParserTest.php.

NewParserTest::$runParsoid = false

Definition at line 21 of file NewParserTest.php.

NewParserTest::$savedGlobals = array()

Definition at line 25 of file NewParserTest.php.

NewParserTest::$savedWeirdGlobals = array()

Definition at line 24 of file NewParserTest.php.

NewParserTest::$showProgress = true

Definition at line 23 of file NewParserTest.php.

TidySupport NewParserTest::$tidySupport [private]

Definition at line 40 of file NewParserTest.php.

NewParserTest::$transparentHooks = array()

Definition at line 28 of file NewParserTest.php.


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