Merge "registration: Only allow one extension to set a specific config setting"
[lhc/web/wiklou.git] / tests / phpunit / suites / ParserTestFileSuite.php
1 <?php
2
3 /**
4 * This is the suite class for running tests within a single .txt source file.
5 * It is not invoked directly. Use --filter to select files, or
6 * use parserTests.php.
7 */
8 class 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 }