4 * This is the TestCase subclass for running a single parser test via the
5 * ParserTestRunner integration test system.
7 * Note: the following groups are not used by PHPUnit.
8 * The list in ParserTestFileSuite::__construct() is used instead.
15 class ParserIntegrationTest
extends PHPUnit_Framework_TestCase
{
19 /** @var ParserTestRunner */
22 /** @var ScopedCallback */
23 private $ptTeardownScope;
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;
32 public function testParse() {
33 $this->ptRunner
->getRecorder()->setTestCase( $this );
34 $result = $this->ptRunner
->runTest( $this->ptTest
);
35 $this->assertEquals( $result->expected
, $result->actual
);
38 public function setUp() {
39 $this->ptTeardownScope
= $this->ptRunner
->staticSetup();
42 public function tearDown() {
43 if ( $this->ptTeardownScope
) {
44 ScopedCallback
::consume( $this->ptTeardownScope
);