Merge "Fix sessionfailure i18n message during authentication"
[lhc/web/wiklou.git] / tests / phpunit / includes / parser / ParserIntegrationTest.php
1 <?php
2 use Wikimedia\ScopedCallback;
3
4 /**
5 * This is the TestCase subclass for running a single parser test via the
6 * ParserTestRunner integration test system.
7 *
8 * Note: the following groups are not used by PHPUnit.
9 * The list in ParserTestFileSuite::__construct() is used instead.
10 *
11 * @group Database
12 * @group Parser
13 * @group ParserTests
14 *
15 * @covers Parser
16 * @covers BlockLevelPass
17 * @covers CoreParserFunctions
18 * @covers CoreTagHooks
19 * @covers Sanitizer
20 * @covers Preprocessor
21 * @covers Preprocessor_DOM
22 * @covers Preprocessor_Hash
23 * @covers DateFormatter
24 * @covers LinkHolderArray
25 * @covers StripState
26 */
27 class ParserIntegrationTest extends PHPUnit_Framework_TestCase {
28
29 use MediaWikiCoversValidator;
30
31 /** @var array */
32 private $ptTest;
33
34 /** @var ParserTestRunner */
35 private $ptRunner;
36
37 /** @var ScopedCallback */
38 private $ptTeardownScope;
39
40 public function __construct( $runner, $fileName, $test ) {
41 parent::__construct( 'testParse', [ '[details omitted]' ],
42 basename( $fileName ) . ': ' . $test['desc'] );
43 $this->ptTest = $test;
44 $this->ptRunner = $runner;
45 }
46
47 public function testParse() {
48 $this->ptRunner->getRecorder()->setTestCase( $this );
49 $result = $this->ptRunner->runTest( $this->ptTest );
50 $this->assertEquals( $result->expected, $result->actual );
51 }
52
53 public function setUp() {
54 $this->ptTeardownScope = $this->ptRunner->staticSetup();
55 }
56
57 public function tearDown() {
58 if ( $this->ptTeardownScope ) {
59 ScopedCallback::consume( $this->ptTeardownScope );
60 }
61 }
62 }