-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache::spy returns an exception: Trying to access array offset on value of type null #41721
Comments
Unfortunately framework/src/Illuminate/Cache/CacheManager.php Lines 80 to 83 in a2708ab
framework/src/Illuminate/Cache/CacheManager.php Lines 416 to 419 in a2708ab
So the Mockery spy is allowing protected method You likely need to change this to a regular Cache::shouldReceive('get')
->once()
->with('test-key')
->andReturn('foo');
$this->get('/')->assertStatus(200); |
Thanks @derekmd |
Description:
I'm not sure why but when I'm trying to make use of Cache::spy, I'm getting this exception:
Trying to access array offset on value of type null
Steps To Reproduce:
The issue can be reproduced with a fresh install:
web.php
ExampleTest.php
If you remove the
assertStatus(200)
, the test passes as expected, otherwise the exception is thrown.The text was updated successfully, but these errors were encountered: