wiki.techinc.nl/tests/phpunit/includes/parser/MediaWikiParserTest.php
Antoine Musso 0fd05285d7 pass codesniffer on tests/
Fix almost all occurences of the following sniffs:

Generic.CodeAnalysis.UselessOverridingMethod.Found
Generic.Formatting.NoSpaceAfterCast.SpaceFound
Generic.Functions.FunctionCallArgumentSpacing.SpaceBeforeComma
Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine
Generic.PHP.LowerCaseConstant.Found
PSR2.Classes.PropertyDeclaration.ScopeMissing
PSR2.Files.EndFileNewline.TooMany
PSR2.Methods.MethodDeclaration.StaticBeforeVisibility

Change-Id: I96aacef5bafe5a2bca659744fba1380999cfc37d
2013-01-28 12:14:26 +01:00

34 lines
1.1 KiB
PHP

<?php
require_once( __DIR__ . '/NewParserTest.php' );
/**
* The UnitTest must be either a class that inherits from MediaWikiTestCase
* or a class that provides a public static suite() method which returns
* an PHPUnit_Framework_Test object
*
* @group Parser
* @group Database
*/
class MediaWikiParserTest {
public static function suite() {
global $wgParserTestFiles;
$suite = new PHPUnit_Framework_TestSuite;
foreach ( $wgParserTestFiles as $filename ) {
$testsName = basename( $filename, '.txt' );
/* This used to be ucfirst( basename( dirname( $filename ) ) )
* and then was ucfirst( basename( $filename, '.txt' )
* but that didn't work with names like foo.tests.txt
*/
$className = str_replace( '.', '_', ucfirst( $testsName ) );
eval( "/** @group Database\n@group Parser\n*/ class $className extends NewParserTest { protected \$file = '" . strtr( $filename, array( "'" => "\\'", '\\' => '\\\\' ) ) . "'; } " );
$parserTester = new $className( $testsName );
$suite->addTestSuite( new ReflectionClass ( $parserTester ) );
}
return $suite;
}
}