From: Brian Wolff Date: Sun, 18 Sep 2011 03:32:43 +0000 (+0000) Subject: Make the phpunit old-style parserTest converter thingy not fall on its face if an... X-Git-Tag: 1.31.0-rc.0~27582 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=4fc3cd0b222201598e70242ce34879b072632b51;p=lhc%2Fweb%2Fwiklou.git Make the phpunit old-style parserTest converter thingy not fall on its face if an extension registers a parserTests test file that has a period in it. --- diff --git a/tests/phpunit/includes/parser/MediaWikiParserTest.php b/tests/phpunit/includes/parser/MediaWikiParserTest.php index eace84bfef..83203b682f 100644 --- a/tests/phpunit/includes/parser/MediaWikiParserTest.php +++ b/tests/phpunit/includes/parser/MediaWikiParserTest.php @@ -18,7 +18,11 @@ class MediaWikiParserTest { foreach ( $wgParserTestFiles as $filename ) { $testsName = basename( $filename, '.txt' ); - $className = /*ucfirst( basename( dirname( $filename ) ) ) .*/ ucfirst( 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( basename( $filename, '.txt' ) ) ); eval( "/** @group Database\n@group Parser\n*/ class $className extends NewParserTest { protected \$file = \"" . addslashes( $filename ) . "\"; } " );