Open samuell opened 11 years ago
This error is raised by using the phpunit.php of the MediaWiki. Before the MakeGood runs tests, the execution of PHP is terminated by the MediaWiki.
Please change the code not to use it. (And require the MediaWikiTestCase.php.)
I'm getting this error as well. PHPUnit 3.7.28. Is MakeGood using an option that is not recognized anymore?
P.S. I have project which has nothing to do with MediaWiki, I suspect the makegood tries to pass some command line args for phpunit with no reason, no-ansi option has never been in PHPUnit.
The problem is in testrunner.php I suspect, I sniffed the command line from the Process Explorer in Windows:
php.exe -c ...\php.ini -d asp_tags=off -d short_open_tag=off \..makegood...\testrunner.php" --no-ansi phpunit --log-junit=....xml --log-junit-realtime --phpunit-config=...
It's not setting --no-ansi
to phpunit, but to testrunner.php
?
Yes, this HACK fixes the problem:
\plugins\com.piece_framework.makegood.stagehandtestrunner_2.5.0.v201311031709\resources\php\bin\testrunner.php
Insert these two lines after the namespace definition:
array_splice($argv, 1, 1);
array_splice($_SERVER['argv'], 1, 1);
These lines removes the --no-ansi
from the command line arguments, you can check this by var_dump($_SERVER['argv']); exit;
when the version changes.
Without delving into what MakeGood is doing with --no-ansi, the reason Wordpress in particular can't use MakeGood without a hacky solution (I modified PHPUnit directly so that it ignored unrecognized command line options) is that the Wordpress-tests booststrap.php passes the entire command line to PHPUnit_Util_Getopt::getopt, probably under the assumption that PHPunit is being run directly. The Wordpress-tests boostrap.php is required to run tests in a Wordpress environment.
So, I guess the question is: Is this a Wordpress problem or a MakeGood problem?
I submitted a bug/patch to Wordpress (http://core.trac.wordpress.org/ticket/26725). The problem Ciantic and I had is really because Wordpress does funky things when it bootstraps its test environment, and not really MakeGood's fault.
Thank you @stickywes.
MakeGood uses own testrunner command instead of the phpunit command to launch a test run. The testrunner command has own command line arguments and options. So PHPUnit cannot recognize our command line.
I'm not using wordpress but have the same issue. Unfortunately, if I try the array_splice hack above I get the error:
PHPUnit 3.7.32 by Sebastian Bergmann.
Cannot open file "--log-junit=/tmp/com.piece_framework.makegood.launch/MakeGood1398899990790.xml".
Clearly the file name should not have the --log-junit= prefix. The phpunit documentation ( http://phpunit.de/manual/3.7/en/textui.html ) suggests it should be --log-junit
@TomBZombie An error "unrecognized option --no-ansi" will be raised only if PHPUnit_TextUI_Command::handleArguments() is called in the test run. Since MakeGood never use PHPUnit_TextUI_Command as the command line parser for PHPUnit, I think that PHPUnit_TextUI_Command::handleArguments() would be called by your test environment.
Getting the same issue for Eclipse Luna, unable to find the code for the plugin which @Ciantic has suggested needs to be tweaked. Can you advise how I can find it?
I'm trying to debug my MediaWiki extension, by requiring the MediaWiki testcases.
After getting everything seemingly set up correct
(I do this:
... I still get this error:
I have grepped through the MediaWiki tests code with:
... and have found no reference. OTOH, I found this string in the sources for the MakeGood plugin, in my eclipse plugins folder, so I'm suspecting that that is where this flag is set.
I'm running: