-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Result XML inconsistent on '@dataProvider returns empty array' or 'is not existing' #13
Comments
To make it clear: i can not notice the skipped test in the "Test Results" window of netbeans. In the command line output (not the XML) i can see the skipped test. Commandline output and xml should be semantic equal. |
The actual issue is that |
For what it's worth, I fixed this in a local branch but it didn't solve the problem with netbeans. Currently the JUnit result printer will not print the same count for test cases and failures or the same errors as the other result printers if any warnings are encountered. Even after fixing the JUnit result printer to match the other result printers, neatbeans still prints misleading results. It seems that neatbeans is only looking at the individual test cases for failures and not the overall test suite results. This is problematic as some warnings refer to errors that occur outside of a specific test case. It's possible to create a specific class of warning that relates to warnings that are encountered while trying to execute a specific test case and then handle those in a way that netbeans can recognize but that doesn't solve the overall problem. I think this is something that will have to be fixed in neatbeans as well. |
If your data provider returns an empty array your xml looks like this: Netbeans shows test suite "Webapp_Model_PhpUnitTest::testMyThing" as skipped. Sorry i can not add a snapshot here. When data provider method is missing the xml for the test suite is missing, too. Which makes netbeans not to show an entry for the skipped test (Webapp_Model_PhpUnitTest::testMyThing). The attributes of the xml element (testsuite)) should be "tests="0" assertions="0" failures="0" errors="0" time="0.000000"" for both: On command line both should result in "FAILURES! Tests: 2, Assertions: 1, Failures: 1". An empty array makes no sense and is a failure. |
Netbeans does not consider the command line output. It considers the xml only. Did you add the missing XML element? If your xml element is equal to |
Okay, I fixed this issue here: http://github.com/whatthejeff/phpunit/tree/topic_13. I made the following changes:
I still think that the JUNIT result printer could be more consistent. Judging from the netbeans source code, netbeans generates the "skipped" message because it knows that an empty test suite normally triggers a warning but it has no access to the actual warning in the JUNIT results. It seems like it would make more sense (and would be more consistent with the actual JUNIT DTD) if warnings were reported inside of the
This would make the JUNIT results printer more consistent with the other result printers and it would allow applications like neatbeans the possibility of handling warnings more gracefully. |
Would be nice if sebastian will merge this soon. |
I hope to see this soon in 3.5.0RCx |
Hi whatthejeff, i can not get the result by using your code. I did a checkout on http://github.com/whatthejeff/phpunit.git and copy the "PHPUnit" folder to the PEAR folder of my XAMPP. But i did not get the |
Make sure you checkout the topic_13 branch as this bug is fixed in that branch and not the master branch. Something along the lines of:
|
Sorry for my incompetence (this is my first time in using git). When i use http://github.com/whatthejeff/phpunit/tree/topic_13 as URL to clone repo via TortoiseGit (Windows) i get the error: |
Just use the download source button at the top of this page: http://github.com/whatthejeff/phpunit/tree/topic_13. |
Closed by 5a83f4a. |
If a data provider function returns an emty array the results XML contains some XML elements about the skipped test (the test method that uses this data provider).
When defining a test method and using a @dataProvider annotation, but pointing to a non existing data provider function this should be create the same XML about the skipped test.
Because of the missing XML about the skipped test (second example above) i can not notice the skipped test in my IDE (netbeans).
The text was updated successfully, but these errors were encountered: