MediaWiki REL1_31
ParserIntegrationTest.php
Go to the documentation of this file.
1<?php
2use Wikimedia\ScopedCallback;
3
30class ParserIntegrationTest extends PHPUnit\Framework\TestCase {
31
32 use MediaWikiCoversValidator;
33
35 private $ptTest;
36
38 private $ptRunner;
39
42
43 public function __construct( $runner, $fileName, $test ) {
44 parent::__construct( 'testParse', [ '[details omitted]' ],
45 basename( $fileName ) . ': ' . $test['desc'] );
46 $this->ptTest = $test;
47 $this->ptRunner = $runner;
48 }
49
50 public function testParse() {
51 $this->ptRunner->getRecorder()->setTestCase( $this );
52 $result = $this->ptRunner->runTest( $this->ptTest );
53 $this->assertEquals( $result->expected, $result->actual );
54 }
55
56 public function setUp() {
57 $this->ptTeardownScope = $this->ptRunner->staticSetup();
58 }
59
60 public function tearDown() {
61 if ( $this->ptTeardownScope ) {
62 ScopedCallback::consume( $this->ptTeardownScope );
63 }
64 }
65}
This is the TestCase subclass for running a single parser test via the ParserTestRunner integration t...
__construct( $runner, $fileName, $test)