3 use Wikimedia\Parsoid\ParserTests\Test
as ParserTest
;
4 use Wikimedia\Parsoid\ParserTests\TestMode
as ParserTestMode
;
7 * This is the TestCase subclass for running a single parser test via the
8 * ParserTestRunner integration test system.
10 * Note: the following groups are not used by PHPUnit.
11 * The list in ParserTestFileSuite::__construct() is used instead.
18 * @covers \MediaWiki\Parser\Parser
19 * @covers \MediaWiki\Parser\BlockLevelPass
20 * @covers \MediaWiki\Parser\CoreParserFunctions
21 * @covers \MediaWiki\Parser\CoreTagHooks
22 * @covers \MediaWiki\Parser\Sanitizer
23 * @covers \MediaWiki\Parser\Preprocessor
24 * @covers \MediaWiki\Parser\Preprocessor_Hash
25 * @covers \MediaWiki\Parser\DateFormatter
26 * @covers \MediaWiki\Parser\LinkHolderArray
27 * @covers \MediaWiki\Parser\StripState
28 * @covers \MediaWiki\Parser\ParserOptions
29 * @covers \MediaWiki\Parser\ParserOutput
31 class ParserIntegrationTest
extends PHPUnit\Framework\TestCase
{
33 use MediaWikiCoversValidator
;
34 use MediaWikiTestCaseTrait
;
36 /** @var ParserTest */
39 /** @var ParserTestMode */
42 /** @var ParserTestRunner */
45 /** @var string|null */
48 public function __construct(
49 ParserTestRunner
$runner,
53 ?
string $skipMessage = null
58 basename( $fileName ) . ': ' . $test->testName
60 $this->ptTest
= $test;
61 $this->ptMode
= $mode;
62 $this->ptRunner
= $runner;
63 $this->skipMessage
= $skipMessage;
66 public function testParse() {
67 if ( $this->skipMessage
!== null ) {
68 $this->markTestSkipped( $this->skipMessage
);
70 $this->ptRunner
->getRecorder()->setTestCase( $this );
71 $result = $this->ptRunner
->runTest( $this->ptTest
, $this->ptMode
);
72 $this->assertEquals( $result->expected
, $result->actual
);