From ffe431dc75138e4bb4209da6471ba9cf748ed569 Mon Sep 17 00:00:00 2001 From: Reedy Date: Fri, 7 Dec 2012 01:11:38 +0000 Subject: [PATCH] Remove code duplication Remove trailing whitespace Change-Id: I31b381c45ccc1631bd17c4d62a1cc1985a4770ba --- tests/phpunit/includes/parser/MediaWikiParserTest.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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; } } -- 2.20.1