Merge "Change file namespace name & and specialpages titles in Urdu"
[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 *
13 * @todo covers tags
14 */
15 class ParserIntegrationTest extends PHPUnit_Framework_TestCase {
16 /** @var array */
17 private $ptTest;
18
19 /** @var ParserTestRunner */
20 private $ptRunner;
21
22 /** @var ScopedCallback */
23 private $ptTeardownScope;
24
25 public function __construct( $runner, $fileName, $test ) {
26 parent::__construct( 'testParse', [ '[details omitted]' ],
27 basename( $fileName ) . ': ' . $test['desc'] );
28 $this->ptTest = $test;
29 $this->ptRunner = $runner;
30 }
31
32 public function testParse() {
33 $this->ptRunner->getRecorder()->setTestCase( $this );
34 $result = $this->ptRunner->runTest( $this->ptTest );
35 $this->assertEquals( $result->expected, $result->actual );
36 }
37
38 public function setUp() {
39 $this->ptTeardownScope = $this->ptRunner->staticSetup();
40 }
41
42 public function tearDown() {
43 if ( $this->ptTeardownScope ) {
44 ScopedCallback::consume( $this->ptTeardownScope );
45 }
46 }
47 }