MediaWiki REL1_32
ParserTestFileSuite.php
Go to the documentation of this file.
1<?php
2
8class ParserTestFileSuite extends PHPUnit_Framework_TestSuite {
9 private $ptRunner;
10 private $ptFileName;
11 private $ptFileInfo;
12
13 function __construct( $runner, $name, $fileName ) {
14 parent::__construct( $name );
15 $this->ptRunner = $runner;
16 $this->ptFileName = $fileName;
17 $this->ptFileInfo = TestFileReader::read( $this->ptFileName );
18
19 foreach ( $this->ptFileInfo['tests'] as $test ) {
20 $this->addTest( new ParserIntegrationTest( $runner, $fileName, $test ),
21 [ 'Database', 'Parser', 'ParserTests' ] );
22 }
23 }
24
25 function setUp() {
26 if ( !$this->ptRunner->meetsRequirements( $this->ptFileInfo['requirements'] ) ) {
27 $this->markTestSuiteSkipped( 'required extension not enabled' );
28 } else {
29 $this->ptRunner->addArticles( $this->ptFileInfo[ 'articles'] );
30 }
31 }
32}
This is the TestCase subclass for running a single parser test via the ParserTestRunner integration t...
This is the suite class for running tests within a single .txt source file.
__construct( $runner, $name, $fileName)
static read( $file, array $options=[])