MediaWiki  master
TestFileReader Class Reference

Static Public Member Functions

static read ($file, array $options=[])
 

Private Member Functions

 __construct ($file, $options)
 
 addArticle ($name, $text, $line)
 
 addCurrentTest ()
 
 addRequirement ($type, $name)
 
 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...
 
 execute ()
 

Private Attributes

 $articles = []
 
 $fh
 
 $file
 
 $lineNum = 0
 
 $regex
 
 $requirements = []
 
 $runDisabled
 
 $runParsoid
 
 $section = null
 
 $sectionData = []
 String|null: current test section being analyzed. More...
 
 $sectionLineNum = []
 
 $tests = []
 

Detailed Description

Definition at line 22 of file TestFileReader.php.

Constructor & Destructor Documentation

TestFileReader::__construct (   $file,
  $options 
)
private

Definition at line 59 of file TestFileReader.php.

References $file, $options, and file.

Member Function Documentation

TestFileReader::addArticle (   $name,
  $text,
  $line 
)
private

Definition at line 323 of file TestFileReader.php.

References $file, $line, and $name.

Referenced by execute().

TestFileReader::addCurrentTest ( )
private

Definition at line 77 of file TestFileReader.php.

References $file, $input, and checkSection().

Referenced by execute().

TestFileReader::addRequirement (   $type,
  $name 
)
private

Definition at line 332 of file TestFileReader.php.

References $name, and $type.

Referenced by execute().

TestFileReader::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 282 of file TestFileReader.php.

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

Referenced by addCurrentTest(), and execute().

TestFileReader::clearSection ( )
private

Clear section name and its data.

Definition at line 263 of file TestFileReader.php.

Referenced by execute().

TestFileReader::execute ( )
private
static TestFileReader::read (   $file,
array  $options = [] 
)
static

Member Data Documentation

TestFileReader::$articles = []
private

Definition at line 34 of file TestFileReader.php.

TestFileReader::$fh
private

Definition at line 24 of file TestFileReader.php.

TestFileReader::$file
private

Definition at line 23 of file TestFileReader.php.

Referenced by __construct(), addArticle(), addCurrentTest(), and read().

TestFileReader::$lineNum = 0
private

Definition at line 29 of file TestFileReader.php.

Referenced by execute().

TestFileReader::$regex
private

Definition at line 32 of file TestFileReader.php.

TestFileReader::$requirements = []
private

Definition at line 35 of file TestFileReader.php.

Referenced by read().

TestFileReader::$runDisabled
private

Definition at line 30 of file TestFileReader.php.

TestFileReader::$runParsoid
private

Definition at line 31 of file TestFileReader.php.

TestFileReader::$section = null
private

Definition at line 25 of file TestFileReader.php.

Referenced by execute().

TestFileReader::$sectionData = []
private

String|null: current test section being analyzed.

Definition at line 27 of file TestFileReader.php.

Referenced by checkSection().

TestFileReader::$sectionLineNum = []
private

Definition at line 28 of file TestFileReader.php.

TestFileReader::$tests = []
private

Definition at line 36 of file TestFileReader.php.


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