-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting "unrecognized option --no-ansi" from phpunit #44
Comments
This error is raised by using the phpunit.php of the MediaWiki. Please change the code not to use it. |
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:
It's not setting |
Yes, this HACK fixes the problem:
These lines removes the |
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: #!/usr/bin/env php 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 not, --log-junit= but removing the equals sign makes no difference and test still cannot be run. I've been struggling for quite some time to get MakeGood working and nothing I do seems to help. |
@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:
#!/usr/bin/env php PHPUnit 3.6.10 by Sebastian Bergmann. unrecognized option --no-ansi
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:
The text was updated successfully, but these errors were encountered: