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.
16 class ParserIntegrationTest
extends PHPUnit_Framework_TestCase
{
20 /** @var ParserTestRunner */
23 /** @var ScopedCallback */
24 private $ptTeardownScope;
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;
33 public function testParse() {
34 $this->ptRunner
->getRecorder()->setTestCase( $this );
35 $result = $this->ptRunner
->runTest( $this->ptTest
);
36 $this->assertEquals( $result->expected
, $result->actual
);
39 public function setUp() {
40 $this->ptTeardownScope
= $this->ptRunner
->staticSetup();
43 public function tearDown() {
44 if ( $this->ptTeardownScope
) {
45 ScopedCallback
::consume( $this->ptTeardownScope
);