public function CacheCollectorTest::testCacheCollector in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/KernelTests/Core/Cache/CacheCollectorTest.php \Drupal\KernelTests\Core\Cache\CacheCollectorTest::testCacheCollector()
- 10 core/tests/Drupal/KernelTests/Core/Cache/CacheCollectorTest.php \Drupal\KernelTests\Core\Cache\CacheCollectorTest::testCacheCollector()
Tests setting and invalidating
@dataProvider providerTestInvalidCharacters
File
- core/
tests/ Drupal/ KernelTests/ Core/ Cache/ CacheCollectorTest.php, line 39
Class
- CacheCollectorTest
- Tests DatabaseBackend cache tag implementation.
Namespace
Drupal\KernelTests\Core\CacheCode
public function testCacheCollector($cid, $key, $value) {
$collector = new CacheCollectorHelper($cid, $this->container
->get('cache.default'), $this->container
->get('lock'));
$this
->assertNull($collector
->get($key));
$collector
->set($key, $value);
$this
->assertEquals($value, $collector
->get($key));
$collector
->destruct();
// @todo Shouldn't this be empty after destruction?
$this
->assertEquals($value, $collector
->get($key));
}