Test runner for parser tests.
More...
|
| __construct (string $testFilePath, ?string $knownFailuresInfix, array $modes) |
|
| run (array $options) |
| Run parser tests for the file with the provided options.
|
|
|
static | getStandaloneMetadataSection (Test $test) |
| Return the appropriate metadata section for this test, given that we are running in parsoid "standalone" mode, or 'null' if none is present.
|
|
Test runner for parser tests.
◆ __construct()
Wikimedia\Parsoid\ParserTests\TestRunner::__construct |
( |
string | $testFilePath, |
|
|
?string | $knownFailuresInfix, |
|
|
array | $modes ) |
- Parameters
-
string | $testFilePath | |
?string | $knownFailuresInfix | |
string[] | $modes | |
◆ getStandaloneMetadataSection()
static Wikimedia\Parsoid\ParserTests\TestRunner::getStandaloneMetadataSection |
( |
Test | $test | ) |
|
|
static |
Return the appropriate metadata section for this test, given that we are running in parsoid "standalone" mode, or 'null' if none is present.
- Parameters
-
- Returns
- ?string The expected metadata for this test
◆ run()
Wikimedia\Parsoid\ParserTests\TestRunner::run |
( |
array | $options | ) |
|
Run parser tests for the file with the provided options.
- Parameters
-
- 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:
- src/ParserTests/TestRunner.php