DEV Community

Discussion on: Laravel Test Driven Development

Collapse
avsecdongol profile image
Abishek Dongol Author

I think cross test conflict may be the reason. Have you tried composer dump-autoload and still same error persist you can run the full test suite using the --process-isolation flag.

Collapse
rolandhesz profile image
Roland Hesz

Hi, in the meantime I found out the issue.
It's a really silly thing, but no tutorial ever explains that while we use PHPUnit for testing, the tests should NOT extend the PHPUnit TestCase class but the one provided by Laravel (\Tests\TestCase).

For some reason, that small, but extremely important piece of information is never mentioned in the articles, Youtube videos, etc. I have seen. That's something people are expected to know.

I didn't. That was the issue. ¯_(ツ)_/¯

Collapse
rolandhesz profile image
Roland Hesz

Still, I put your advice away in my "things to know" folder, probably will come handy at some point.