Parsoid
A bidirectional parser between wikitext and HTML5
Loading...
Searching...
No Matches
Wikimedia\Parsoid\ParserTests\TestRunner Class Reference

Test runner for parser tests. More...

Public Member Functions

 __construct (string $testFilePath, ?string $knownFailuresInfix, array $modes)
 
 run (array $options)
 Run parser tests for the file with the provided options.
 

Detailed Description

Test runner for parser tests.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Parsoid\ParserTests\TestRunner::__construct ( string $testFilePath,
?string $knownFailuresInfix,
array $modes )
Parameters
string$testFilePath
?string$knownFailuresInfix
string[]$modes

Member Function Documentation

◆ run()

Wikimedia\Parsoid\ParserTests\TestRunner::run ( array $options)

Run parser tests for the file with the provided options.

Parameters
array$options
Returns
array

PORT-FIXME(T238722) // Enable sampling to assert it's working while testing. $parsoidConfig->loggerSampling = [ [ '/^warn(\/|$)/', 100 ] ];

// Override env's setLogger to record if we see fatal or error // while running parser tests. (Keep it clean, folks! Use // "suppressError" option on the test if error is expected.) $env->setLogger = ( ( function ( $parserTests, $superSetLogger ) { return function ( $_logger ) use ( &$parserTests ) { call_user_func( 'superSetLogger', $_logger ); $this->log = function ( $level ) use ( &$_logger, &$parserTests ) { if ( $_logger !== $parserTests->suppressLogger && preg_match( '/^(fatal|error)/', $level ) ) { $parserTests->stats->loggedErrorCount++; } return call_user_func_array( [ $_logger, 'log' ], $arguments ); }; }; } ) );


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