function GenericCacheBackendUnitTestBase::getCacheBackend
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php \Drupal\KernelTests\Core\Cache\GenericCacheBackendUnitTestBase::getCacheBackend()
- 8.9.x core/modules/system/src/Tests/Cache/GenericCacheBackendUnitTestBase.php \Drupal\system\Tests\Cache\GenericCacheBackendUnitTestBase::getCacheBackend()
- 8.9.x core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php \Drupal\KernelTests\Core\Cache\GenericCacheBackendUnitTestBase::getCacheBackend()
- 10 core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php \Drupal\KernelTests\Core\Cache\GenericCacheBackendUnitTestBase::getCacheBackend()
Gets a backend to test; this will get a shared instance set in the object.
Return value
\Drupal\Core\Cache\CacheBackendInterface Cache backend to test.
14 calls to GenericCacheBackendUnitTestBase::getCacheBackend()
- ApcuBackendTest::testSetGet in core/
tests/ Drupal/ KernelTests/ Core/ Cache/ ApcuBackendTest.php - Tests the get and set methods of Drupal\Core\Cache\CacheBackendInterface.
- DatabaseBackendTest::testGarbageCollection in core/
tests/ Drupal/ KernelTests/ Core/ Cache/ DatabaseBackendTest.php - Tests the row count limiting of cache bin database tables.
- DatabaseBackendTest::testSetGet in core/
tests/ Drupal/ KernelTests/ Core/ Cache/ DatabaseBackendTest.php - Tests the get and set methods of Drupal\Core\Cache\CacheBackendInterface.
- GenericCacheBackendUnitTestBase::testDelete in core/
tests/ Drupal/ KernelTests/ Core/ Cache/ GenericCacheBackendUnitTestBase.php - Tests Drupal\Core\Cache\CacheBackendInterface::delete().
- GenericCacheBackendUnitTestBase::testDeleteAll in core/
tests/ Drupal/ KernelTests/ Core/ Cache/ GenericCacheBackendUnitTestBase.php - Tests Drupal\Core\Cache\CacheBackendInterface::deleteAll().
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Cache/ GenericCacheBackendUnitTestBase.php, line 94
Class
- GenericCacheBackendUnitTestBase
- Tests any cache backend.
Namespace
Drupal\KernelTests\Core\CacheCode
protected function getCacheBackend($bin = NULL) {
if (!isset($bin)) {
$bin = $this->getTestBin();
}
if (!isset($this->cacheBackends[$bin])) {
$this->cacheBackends[$bin] = $this->createCacheBackend($bin);
// Ensure the backend is empty.
$this->cacheBackends[$bin]
->deleteAll();
}
return $this->cacheBackends[$bin];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.