hacktest icon indicating copy to clipboard operation
hacktest copied to clipboard

"Only test methods and data providers can be public" message for a dataprovider

Open fredemmott opened this issue 8 years ago • 2 comments

Fatal error: Uncaught exception 'Facebook\HackTest\InvalidTestMethodException' with message 'Only test methods and data providers can be public. Consider changing getCleanExamples to a private or protected method.' in /Users/fredemmott/code/hhast/vendor/hhvm/hacktest/src/Framework/HackTestCase.php:122
Stack trace:
#0 /Users/fredemmott/code/hhast/vendor/hhvm/hacktest/src/Framework/HackTestCase.php(25): Facebook\HackTest\HackTestCase->getTestMethods()

Either the restriction should be loosened, or the message should include something along the lines of 'or rename the method to start with provide if it is a data provider'

fredemmott avatar Jul 20 '18 23:07 fredemmott

Perhaps 'get' should also be allowed as a prefix - or included in a migration for anything referenced in @dataprovider (including in subclasses)

fredemmott avatar Jul 20 '18 23:07 fredemmott

Also would be nice to include the class name in the message

fredemmott avatar Jul 20 '18 23:07 fredemmott