r97400 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97399‎ | r97400 | r97401 >
Date:03:32, 18 September 2011
Author:bawolff
Status:ok
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/parser/MediaWikiParserTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/parser/MediaWikiParserTest.php
@@ -18,7 +18,11 @@
1919
2020 foreach ( $wgParserTestFiles as $filename ) {
2121 $testsName = basename( $filename, '.txt' );
22 - $className = /*ucfirst( basename( dirname( $filename ) ) ) .*/ ucfirst( basename( $filename, '.txt' ) );
 22+ /* This used to be ucfirst( basename( dirname( $filename ) ) )
 23+ * and then was ucfirst( basename( $filename, '.txt' )
 24+ * but that didn't work with names like foo.tests.txt
 25+ */
 26+ $className = str_replace( '.', '_', ucfirst( basename( $filename, '.txt' ) ) );
2327
2428 eval( "/** @group Database\n@group Parser\n*/ class $className extends NewParserTest { protected \$file = \"" . addslashes( $filename ) . "\"; } " );
2529

Status & tagging log