MediaWiki  1.27.2
TestFileIterator Class Reference
Inheritance diagram for TestFileIterator:
Collaboration diagram for TestFileIterator:

Public Member Functions

 __construct ($file, $parserTest)
 
 current ()
 
 key ()
 
 next ()
 
 readNextTest ()
 
 rewind ()
 
 setupCurrentTest ()
 
 valid ()
 

Private Member Functions

 checkSection ($tokens, $fatal=true)
 Verify the current section data has some value for the given token name(s) (first parameter). More...
 
 clearSection ()
 Clear section name and its data. More...
 

Private Attributes

 $delayedParserTest
 
 $eof
 
 $fh
 
 $file
 
 $index = 0
 
 $lineNum
 
 $nextSubTest = 0
 
ParserTest MediaWikiParserTest $parserTest
 An instance of ParserTest (parserTests.php) or MediaWikiParserTest (phpunit) More...
 
 $section = null
 
 $sectionData = []
 String|null: current test section being analyzed. More...
 
 $test
 

Detailed Description

Definition at line 382 of file testHelpers.inc.

Constructor & Destructor Documentation

TestFileIterator::__construct (   $file,
  $parserTest 
)

Definition at line 402 of file testHelpers.inc.

References $file, $parserTest, and file.

Member Function Documentation

TestFileIterator::checkSection (   $tokens,
  $fatal = true 
)
private

Verify the current section data has some value for the given token name(s) (first parameter).

Throw an exception if it is not set, referencing current section and adding the current file name and line number

Parameters
string | array$tokensExpected token(s) that should have been mentioned before closing this section
bool$fatalTrue iff an exception should be thrown if the section is not found.
Returns
bool|string
Exceptions
MWException

Definition at line 643 of file testHelpers.inc.

References $sectionData, $tokens, file, and use.

Referenced by readNextTest(), and setupCurrentTest().

TestFileIterator::clearSection ( )
private

Clear section name and its data.

Definition at line 624 of file testHelpers.inc.

Referenced by readNextTest().

TestFileIterator::current ( )

Definition at line 429 of file testHelpers.inc.

References $test.

TestFileIterator::key ( )

Definition at line 433 of file testHelpers.inc.

References $index.

TestFileIterator::next ( )

Definition at line 437 of file testHelpers.inc.

References readNextTest().

Referenced by rewind().

TestFileIterator::readNextTest ( )

Definition at line 510 of file testHelpers.inc.

References $line, $matches, $section, as, checkSection(), ParserTest\chomp(), clearSection(), and setupCurrentTest().

Referenced by next().

TestFileIterator::rewind ( )

Definition at line 416 of file testHelpers.inc.

References next().

TestFileIterator::setupCurrentTest ( )

Definition at line 450 of file testHelpers.inc.

References $nextSubTest, checkSection(), ParserTest\chomp(), and wfDebug().

Referenced by readNextTest().

TestFileIterator::valid ( )

Definition at line 446 of file testHelpers.inc.

Member Data Documentation

TestFileIterator::$delayedParserTest
private

Definition at line 399 of file testHelpers.inc.

TestFileIterator::$eof
private

Definition at line 396 of file testHelpers.inc.

TestFileIterator::$fh
private

Definition at line 384 of file testHelpers.inc.

TestFileIterator::$file
private

Definition at line 383 of file testHelpers.inc.

Referenced by __construct().

TestFileIterator::$index = 0
private

Definition at line 390 of file testHelpers.inc.

Referenced by key().

TestFileIterator::$lineNum
private

Definition at line 395 of file testHelpers.inc.

TestFileIterator::$nextSubTest = 0
private

Definition at line 400 of file testHelpers.inc.

Referenced by setupCurrentTest().

ParserTest MediaWikiParserTest TestFileIterator::$parserTest
private

An instance of ParserTest (parserTests.php) or MediaWikiParserTest (phpunit)

Definition at line 389 of file testHelpers.inc.

Referenced by __construct().

TestFileIterator::$section = null
private

Definition at line 392 of file testHelpers.inc.

Referenced by readNextTest().

TestFileIterator::$sectionData = []
private

String|null: current test section being analyzed.

Definition at line 394 of file testHelpers.inc.

Referenced by checkSection().

TestFileIterator::$test
private

Definition at line 391 of file testHelpers.inc.

Referenced by current(), and TestFileDataProvider\current().


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