Index: trunk/phase3/tests/phpunit/includes/parser/MediaWikiParserTest.php |
— | — | @@ -0,0 +1,35 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +require_once( dirname( __FILE__ ) . '/ParserHelpers.php' ); |
| 5 | +require_once( dirname( __FILE__ ) . '/NewParserTest.php' ); |
| 6 | +require_once( dirname(dirname(dirname( __FILE__ ))) . '/bootstrap.php' ); |
| 7 | + |
| 8 | +/** |
| 9 | + * The UnitTest must be either a class that inherits from PHPUnit_Framework_TestCase |
| 10 | + * or a class that provides a public static suite() method which returns |
| 11 | + * an PHPUnit_Framework_Test object |
| 12 | + * |
| 13 | + * @group Parser |
| 14 | + * @group Database |
| 15 | + */ |
| 16 | +class MediaWikiParserTest { |
| 17 | + |
| 18 | + public static function suite() { |
| 19 | + global $wgParserTestFiles; |
| 20 | + |
| 21 | + $suite = new PHPUnit_Framework_TestSuite; |
| 22 | + |
| 23 | + foreach ( $wgParserTestFiles as $filename ) { |
| 24 | + $testsName = basename( $filename, '.txt' ); |
| 25 | + $className = /*ucfirst( basename( dirname( $filename ) ) ) .*/ ucfirst( basename( $filename, '.txt' ) ); |
| 26 | + |
| 27 | + eval( "/** @group Database\n@group Parser\n*/ class $className extends NewParserTest { protected \$file = \"" . addslashes( $filename ) . "\"; } " ); |
| 28 | + |
| 29 | + $parserTester = new $className( $testsName ); |
| 30 | + $suite->addTestSuite( new ReflectionClass ( $parserTester ) ); |
| 31 | + } |
| 32 | + |
| 33 | + |
| 34 | + return $suite; |
| 35 | + } |
| 36 | +} |
Property changes on: trunk/phase3/tests/phpunit/includes/parser/MediaWikiParserTest.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
1 | 37 | Merged /branches/REL1_15/phase3/tests/phpunit/includes/parser/MediaWikiParserTest.php:r51646 |
2 | 38 | Merged /branches/REL1_17/phase3/tests/phpunit/includes/parser/MediaWikiParserTest.php:r81445,81448 |
3 | 39 | Merged /branches/sqlite/tests/phpunit/includes/parser/MediaWikiParserTest.php:r58211-58321 |
4 | 40 | Merged /branches/new-installer/phase3/tests/phpunit/includes/parser/MediaWikiParserTest.php:r43664-66004 |
Added: svn:eol-style |
5 | 41 | + native |