Hi all,
Just upgraded Laravel from v9 to v10 using Shift. Also upgraded PHPUnit to 10 and Pest to v2.
I've noticed some strange behaviour in my tests after the upgrade:
Example 1:
I've set a rate limit on throttle of 3 attempts on /example-route . If I run my tests a few times, I'll get a 429 error indicating too many requests. I expect the count to reset after each tests like it did before.
Example 2:
I've got ExampleController which uses Cache::remember() to retrieve data from cache and otherwise retrieve the latest value. I've noticed the cache is remembered and not resetted after each test. For example: if I use
return Cache::remember('example', 1800, fn () => 'Hi');
Run my test, change Hi to Bye and run the test again, I get Hi while I expect Bye
If I add Cache::flush() to my test, i get Bye and it works as expected
I've already checked .env.testing and phpunit.xml for APP_ENV.
I'm running the tests in a Docker container which initially exports .env