Added release notes for 'ContentHandler::runLegacyHooks' removal
[mediawiki.git] / tests / phpunit / includes / parser / ParserIntegrationTest.php
blobc92098248c60fcd030a9d13c32c8f31f5ff4f461
1 <?php
2 use Wikimedia\ScopedCallback;
4 /**
5 * This is the TestCase subclass for running a single parser test via the
6 * ParserTestRunner integration test system.
8 * Note: the following groups are not used by PHPUnit.
9 * The list in ParserTestFileSuite::__construct() is used instead.
11 * @group Database
12 * @group Parser
13 * @group ParserTests
15 * @todo covers tags
17 class ParserIntegrationTest extends PHPUnit_Framework_TestCase {
18 /** @var array */
19 private $ptTest;
21 /** @var ParserTestRunner */
22 private $ptRunner;
24 /** @var ScopedCallback */
25 private $ptTeardownScope;
27 public function __construct( $runner, $fileName, $test ) {
28 parent::__construct( 'testParse', [ '[details omitted]' ],
29 basename( $fileName ) . ': ' . $test['desc'] );
30 $this->ptTest = $test;
31 $this->ptRunner = $runner;
34 public function testParse() {
35 $this->ptRunner->getRecorder()->setTestCase( $this );
36 $result = $this->ptRunner->runTest( $this->ptTest );
37 $this->assertEquals( $result->expected, $result->actual );
40 public function setUp() {
41 $this->ptTeardownScope = $this->ptRunner->staticSetup();
44 public function tearDown() {
45 if ( $this->ptTeardownScope ) {
46 ScopedCallback::consume( $this->ptTeardownScope );