An integration test that clears the cache mid-scenario and asserts the application still behaves.
public function test_the_application_survives_a_cache_flush(): void
{
$this->actingAs($user)->put('/preferences', ['theme' => 'dark'])
->assertOk();
Cache::flush();
$this->actingAs($user)->get('/preferences')
->assertJsonPath('theme', 'dark'); // FAILED
}
The failure is the point: a preference written to the cache and nowhere else survives until the first eviction, and no other test would ever have flushed. It generalises to any store with a lifetime shorter than the data — a test that clears it between the write and the read is four lines and finds a category of bug that is otherwise found in production.