Tray2's avatar
Level 74

phpunit class env does not exist?

All of a sudden all my tests except one fails stating that class env does not exist. The only thing I've done since I last had all my tests passing is updated some of my view files so I pretty much rule that out since it should only affect a couple of my tests. If I run them one by one they seems to pass like they should (Tested about ten of them). I tried updating to the latest version of Laravel and still no luck.

I also installed Laravel Telescope after my last successfull test so I'm thinking that might be the cause.

I use an sqlite in memory database.

117) Tests\Unit\GenreTest::genre_must_be_unique
ReflectionException: Class env does not exist

And about a 150 more of those.

Any ideas on how to get it to working state again? As a last resort I can go back to my last commit but it would be nice to know waht the issue is. Saw that it has been reported as a bug but no solution work in my case.

0 likes
3 replies
Tray2's avatar
Level 74

That worked :) Thank you so much.

PHPUnit 7.5.1 by Sebastian Bergmann and contributors.

...............................................................  63 / 127 ( 49%)
............................................................... 126 / 127 ( 99%)
.                                                               127 / 127 (100%)

Time: 12.03 seconds, Memory: 32.00MB

OK (127 tests, 367 assertions)
2 likes
steve_laracasts's avatar

Thank you @d9705996

This has resolved what I hope is the LAST error in configuring TDD in Spark (ha!)

For the first time in a week all my tests are passing and there are no weird inexplicable mind bending errors!

Phew...

Please or to participate in this conversation.