wiki.techinc.nl/tests/phpunit/suites/ParserTestFileSuite.php
Tim Starling 364f57965f Re-add parser tests to the ParserTests group
It was omitted due to the new way in which parser test TestCase objects
are constructed. Should fix Jenkins double-execution of parser tests.

Change-Id: I8131c3b13f2e08f784bce46fee16051c14761304
2016-09-15 09:39:20 +10:00

28 lines
797 B
PHP

<?php
/**
* This is the suite class for running tests within a single .txt source file.
* It is not invoked directly. Use --filter to select files, or
* use parserTests.php.
*/
class ParserTestFileSuite extends PHPUnit_Framework_TestSuite {
private $ptRunner;
private $ptFileName;
private $ptFileInfo;
function __construct( $runner, $name, $fileName ) {
parent::__construct( $name );
$this->ptRunner = $runner;
$this->ptFileName = $fileName;
$this->ptFileInfo = TestFileReader::read( $this->ptFileName );
foreach ( $this->ptFileInfo['tests'] as $test ) {
$this->addTest( new ParserIntegrationTest( $runner, $fileName, $test ),
[ 'Database', 'Parser', 'ParserTests' ] );
}
}
function setUp() {
$this->ptRunner->addArticles( $this->ptFileInfo[ 'articles'] );
}
}