r89223 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89222‎ | r89223 | r89224 >
Date:19:51, 31 May 2011
Author:hashar
Status:reverted (Comments)
Tags:
Comment:
NewParserTest.php can now work independently

PHPUnit load class according to their order on the filesystem I guess.
On the cruisecontrol host, it first load NewParserTest.php and run
the test then load MediaWikiParserTest.php which run the tests too!

On my host the order is reversed, and NewParserTest.php is never run
for a reason I have not investigated.

Anyway, deleting the MediaWikiParserTest.php is harmless since it is
redundant with NewParserTest.php

(should fix cruise control)
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/parser/MediaWikiParserTest.php (deleted) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/parser/MediaWikiParserTest.php
@@ -1,35 +0,0 @@
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 -}

Follow-up revisions

RevisionCommit summaryAuthorDate
r89226Revert r89223. MediaWikiParserTest is needed to run all the $wgParserTestFiles...platonides20:30, 31 May 2011
r89227really add NewParserTest to the Stub group...hashar20:35, 31 May 2011

Comments

#Comment by Hashar (talk | contribs)   20:04, 31 May 2011

As of build 2011-05-31T19:56:48 :

Before:

failure  	NewParserTest::testParserTest::testParserTest with data set #287()
failure 	ParserTests::testParserTest::testParserTest with data set #287()

After:

failure  	NewParserTest::testParserTest::testParserTest with data set #287()

So we should save up sometime now!

Status & tagging log