hhvm / hacktest

A unit testing framework for Hack
MIT License
29 stars 13 forks source link

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

Open fredemmott opened 6 years ago

fredemmott commented 6 years ago
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 commented 6 years ago

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

fredemmott commented 6 years ago

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