Open zerkms opened 11 years ago
Do correct @dataProvider methods work? If you want to improve the error message I will look at a PR
Correct @dataProvider
does work, but it was tricky to find out the issue, since the original error message was lost and not informative was output
I encountered the same problem on a fresh installation from PEAR today. I'm getting:
phpunit --verbose functional/GTest.php
PHP Fatal error: Call to undefined method PHPUnit_Framework_Warning::setupSpecificBrowser() in /usr/lib/php/pear/PHPUnit/Extensions/SeleniumBrowserSuite.php on line 95 PHP Stack trace: PHP 1. {main}() /usr/bin/phpunit:0 PHP 2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46 PHP 3. PHPUnit_TextUI_Command->run() /usr/lib/php/pear/PHPUnit/TextUI/Command.php:129 PHP 4. PHPUnit_Runner_BaseTestRunner->getTest() /usr/lib/php/pear/PHPUnit/TextUI/Command.php:150 PHP 5. ReflectionMethod->invoke() /usr/lib/php/pear/PHPUnit/Runner/BaseTestRunner.php:124 PHP 6. PHPUnit_Extensions_SeleniumTestCase::suite() /usr/lib/php/pear/PHPUnit/Runner/BaseTestRunner.php:124 PHP 7. PHPUnit_Extensions_SeleniumTestSuite::fromTestCaseClass() /usr/lib/php/pear/PHPUnit/Extensions/SeleniumTestCase.php:618 PHP 8. PHPUnit_Extensions_SeleniumBrowserSuite->setupSpecificBrowser() /usr/lib/php/pear/PHPUnit/Extensions/SeleniumTestSuite.php:135 PHP 9. PHPUnit_Extensions_SeleniumBrowserSuite->browserOnAllTests() /usr/lib/php/pear/PHPUnit/Extensions/SeleniumBrowserSuite.php:86
When I checked the code that causes the error, it appeared, that actually I'm getting PHPUnit_Framework_Warning with the error: Test method "testNotBannedGroupNewsList" in test class "GTest" is not public., which remains hidden and difficult to troubleshoot.
@yugenekr, as long as there are at least two of us I will try to provide a pull-request then
Well, for me phpunit 3.6.10 (just a phpunit without selenium, in similar case) behaves even worse - it just skips the test with issue without any notifications.
The current implementation looks like:
How to reproduce: create a test with wrong
@dataProvider
, likereturn array(1,2,3);
Stacktrace:
UPD: the message in the
PHPUnit_Framework_Warning
isThe data provider specified for FiltersTest::testFilterByNull is invalid.\nData set #0 is invalid.
So seems like this warning should be forwarded further without running?