From: Reedy Date: Fri, 7 Dec 2012 01:11:38 +0000 (+0000) Subject: Remove code duplication X-Git-Tag: 1.31.0-rc.0~21392^2 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=ffe431dc75138e4bb4209da6471ba9cf748ed569;p=lhc%2Fweb%2Fwiklou.git Remove code duplication Remove trailing whitespace Change-Id: I31b381c45ccc1631bd17c4d62a1cc1985a4770ba --- diff --git a/tests/phpunit/includes/parser/MediaWikiParserTest.php b/tests/phpunit/includes/parser/MediaWikiParserTest.php index 6a6fded17a..b15365c0c0 100644 --- a/tests/phpunit/includes/parser/MediaWikiParserTest.php +++ b/tests/phpunit/includes/parser/MediaWikiParserTest.php @@ -22,15 +22,13 @@ class MediaWikiParserTest { * and then was ucfirst( basename( $filename, '.txt' ) * but that didn't work with names like foo.tests.txt */ - $className = str_replace( '.', '_', ucfirst( basename( $filename, '.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; } }