Make the phpunit old-style parserTest converter thingy not fall on its face if an...
authorBrian Wolff <bawolff@users.mediawiki.org>
Sun, 18 Sep 2011 03:32:43 +0000 (03:32 +0000)
committerBrian Wolff <bawolff@users.mediawiki.org>
Sun, 18 Sep 2011 03:32:43 +0000 (03:32 +0000)
tests/phpunit/includes/parser/MediaWikiParserTest.php

index eace84b..83203b6 100644 (file)
@@ -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 ) . "\"; } " );