Localisation updates from https://translatewiki.net.
[mediawiki.git] / tests / phpunit / suites / ParserIntegrationTest.php
blobe3bf33df14d46681e017db6f706dad987e8462a0
1 <?php
3 use Wikimedia\Parsoid\ParserTests\Test as ParserTest;
4 use Wikimedia\Parsoid\ParserTests\TestMode as ParserTestMode;
6 /**
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.
13 * @group large
14 * @group Database
15 * @group Parser
16 * @group ParserTests
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 */
37 private $ptTest;
39 /** @var ParserTestMode */
40 private $ptMode;
42 /** @var ParserTestRunner */
43 private $ptRunner;
45 /** @var string|null */
46 private $skipMessage;
48 public function __construct(
49 ParserTestRunner $runner,
50 string $fileName,
51 ParserTest $test,
52 ParserTestMode $mode,
53 ?string $skipMessage = null
54 ) {
55 parent::__construct(
56 'testParse',
57 [ "$mode" ],
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 );