r72799 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72798‎ | r72799 | r72800 >
Date:12:20, 11 September 2010
Author:platonides
Status:resolved (Comments)
Tags:
Comment:
Changing paths so that they work both on Unix and Windows.
Added an ughly conditional to support both the normal location on svn checkout and jeroen one.

It can be run as phpunit <something> Maps/test/Maps...ParserTest.php
Modified paths:
  • /trunk/extensions/Maps/test/MapsCoordinateParserTest.php (modified) (history)
  • /trunk/extensions/Maps/test/MapsDistanceParserTest.php (modified) (history)
  • /trunk/extensions/Maps/test/MapsTestSuite.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/test/MapsTestSuite.php
@@ -1,6 +1,6 @@
22 <?php
33
4 -require_once 'PHPUnit\Framework\TestSuite.php';
 4+require_once 'PHPUnit/Framework/TestSuite.php';
55
66 /**
77 * Static test suite.
Index: trunk/extensions/Maps/test/MapsCoordinateParserTest.php
@@ -1,11 +1,12 @@
22 <?php
33
4 -require_once 'PHPUnit\Framework\TestCase.php';
 4+require_once 'PHPUnit/Framework/TestCase.php';
55
66 // Trick MW into thinking this is a command line script.
77 // This is obviously not a good approach, as it will not work on other setups then my own.
88 unset( $_SERVER['REQUEST_METHOD'] );
99 $argv = array( 'over9000failz' );
 10+( include dirname(__FILE__) . '/../../../phase3/maintenance/commandLine.inc' ) or
1011 require_once '../../../smw/maintenance/commandLine.inc';
1112
1213 /**
@@ -311,4 +312,4 @@
312313 }
313314 }
314315
315 -}
\ No newline at end of file
 316+}
Index: trunk/extensions/Maps/test/MapsDistanceParserTest.php
@@ -1,11 +1,12 @@
22 <?php
33
4 -require_once 'PHPUnit\Framework\TestCase.php';
 4+require_once 'PHPUnit/Framework/TestCase.php';
55
66 // Trick MW into thinking this is a command line script.
77 // This is obviously not a good approach, as it will not work on other setups then my own.
88 unset( $_SERVER['REQUEST_METHOD'] );
99 $argv = array( 'over9000failz' );
 10+( include dirname(__FILE__) . '/../../../phase3/maintenance/commandLine.inc' ) or
1011 require_once '../../../smw/maintenance/commandLine.inc';
1112
1213 /**
@@ -176,4 +177,4 @@
177178
178179 }
179180
180 -}
\ No newline at end of file
 181+}

Follow-up revisions

RevisionCommit summaryAuthorDate
r72800Follow up r72799....platonides12:21, 11 September 2010
r73381Follow up r72799, using MW_INSTALL_PATH and moving the logic to find maintena...platonides15:38, 20 September 2010

Comments

#Comment by 😂 (talk | contribs)   05:38, 15 September 2010

/phase3? That won't work for very many people either.

#Comment by Platonides (talk | contribs)   17:53, 15 September 2010

Tests are more intended for developers (for which this is likely to work) than for users (for which it won't).

Improvements welcome.

#Comment by 😂 (talk | contribs)   19:30, 15 September 2010

FWIW, this will only work on *one* of my checked out copies...the one named phase3. I would expect it to work for all of them.

#Comment by Platonides (talk | contribs)   21:20, 15 September 2010

Where are them relative to Maps extensions folder?

(if you don't checkout Maps with them, no candys for you)

Do you usually set MW_INSTALL_PATH before using them?

#Comment by 😂 (talk | contribs)   21:41, 15 September 2010

I don't have Maps checked out on any of them, I'm just talking generally.

No, I don't set MW_INSTALL_PATH. Not like it would make a difference in this case, since you're still hardcoding phase3.

#Comment by Platonides (talk | contribs)   12:49, 16 September 2010

Then if you were going to checkout all extensions, wouldn't that be on a tree similar to the svn one?

We could replace this with a check MW_INSTALL_PATH, but I don't think it is common to have it set (thus the question).

#Comment by 😂 (talk | contribs)   12:55, 16 September 2010

Using MW_INSTALL_PATH would be nice :)

#Comment by Platonides (talk | contribs)   15:38, 20 September 2010

Done in r73381.

Status & tagging log