Test Drupal\Core\Cache\CacheBackendInterface::invalidateAll().
public function testInvalidateAll() {
$backend = $this
->getCacheBackend();
// Set both expiring and permanent keys.
$backend
->set('test1', 1, CacheBackendInterface::CACHE_PERMANENT);
$backend
->set('test2', 3, time() + 1000);
$backend
->invalidateAll();
$this
->assertFalse($backend
->get('test1'), 'First key has been invalidated.');
$this
->assertFalse($backend
->get('test2'), 'Second key has been invalidated.');
$this
->assertTrue($backend
->get('test1', TRUE), 'First key has not been deleted.');
$this
->assertTrue($backend
->get('test2', TRUE), 'Second key has not been deleted.');
}