Cache mocks don't work with Laravel 9 & Testbench 7
yondifon opened this issue · 2 comments
yondifon commented
- Testbench Version:7.1.0
- Laravel Version: 9.3.0
- PHP Version: 8.0
- Database Driver & Version: 8.x
Description:
Any time I try to use mock the Cache Fascade within my tests, it fails. It throughs an error Received Mockery_2_Illuminate_Cache_CacheManager::store(), but no expectations were specified
even though I didn't try to call the store method.
i.e. This works in a Laravel installation.
Steps To Reproduce:
Setup a testbench version with Laravel
Copy the default example from Laravel documentation into a testcase.
public function testGetIndex()
{
Cache::shouldReceive('get')
->once()
->with('key')
->andReturn('value');
$response = $this->get('/users');
You see an error like the one mentioned above.
crynobone commented
Submit failing test PR to testbench-core repository.
yondifon commented
Sorry about this. False Alarm