Merge "Deprecfate WikiRevision::getText"
[lhc/web/wiklou.git] / tests / phpunit / includes / parser / ParserIntegrationTest.php
1 <?php
2
3 /**
4 * This is the TestCase subclass for running a single parser test via the
5 * ParserTestRunner integration test system.
6 *
7 * Note: the following groups are not used by PHPUnit.
8 * The list in ParserTestFileSuite::__construct() is used instead.
9 *
10 * @group Database
11 * @group Parser
12 * @group ParserTests
13 *
14 * @todo covers tags
15 */
16 class ParserIntegrationTest extends PHPUnit_Framework_TestCase {
17 /** @var array */
18 private $ptTest;
19
20 /** @var ParserTestRunner */
21 private $ptRunner;
22
23 /** @var ScopedCallback */
24 private $ptTeardownScope;
25
26 public function __construct( $runner, $fileName, $test ) {
27 parent::__construct( 'testParse', [ '[details omitted]' ],
28 basename( $fileName ) . ': ' . $test['desc'] );
29 $this->ptTest = $test;
30 $this->ptRunner = $runner;
31 }
32
33 public function testParse() {
34 $this->ptRunner->getRecorder()->setTestCase( $this );
35 $result = $this->ptRunner->runTest( $this->ptTest );
36 $this->assertEquals( $result->expected, $result->actual );
37 }
38
39 public function setUp() {
40 $this->ptTeardownScope = $this->ptRunner->staticSetup();
41 }
42
43 public function tearDown() {
44 if ( $this->ptTeardownScope ) {
45 ScopedCallback::consume( $this->ptTeardownScope );
46 }
47 }
48 }