You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After some debugging, with no functionality from TestCase::class, I figured out I had to combine these, or else the latter will override the former, leaving TestCase functionality out of my tests.
This gave me errors like
InvalidArgumentException
Unable to locate factory for [App\Category].
and
Error
Call to undefined method Tests\Feature\AddingStatementsToCategoriesTest::get()
You are not stupid :)
Indeed I think we could improve the doc clarity on that point.
You can submit a revised version of the documentation page, just click the "Edit this page" link on the top right 🙂
If you prefer, you can also open an issue with your edit suggestion on the Pest website repo: https://github.com/pestphp/website and I'll be happy to edit/publish it into the doc.
I added a new line in my Pest.php, below
uses(TestCase::class)->in('Feature');
:uses(RefreshDatabase::class)->in('Feature');
Like suggested in https://pestphp.com/docs/underlying-test-case/
After some debugging, with no functionality from TestCase::class, I figured out I had to combine these, or else the latter will override the former, leaving TestCase functionality out of my tests.
This gave me errors like
and
when trying to use pestphp on Laravel 7.
I fixed it all this way:
Maybe the documentation could be clearer about this, or I'm just stupid for trying ;-).
The text was updated successfully, but these errors were encountered: