function YamlCacheCollectorTest::testUpdateCache
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Core/Utility/YamlCacheCollectorTest.php \Drupal\Tests\Core\Utility\YamlCacheCollectorTest::testUpdateCache()
Tests the ::updateCache() function.
File
-
core/
tests/ Drupal/ Tests/ Core/ Utility/ YamlCacheCollectorTest.php, line 71
Class
Namespace
Drupal\Tests\Core\UtilityCode
public function testUpdateCache() : void {
$this->cacheBackend
->set('key', [
'/foo/bar/foo_bar.txt' => [
'data' => [
TRUE,
],
'mtime' => 12345,
],
]);
$this->collector
->set('/foo/bar/foo_bar.txt', [
'data' => [
'hello',
],
'mtime' => 12345,
]);
$this->collector
->updateCache();
$this->assertSame($this->collector
->get('/foo/bar/foo_bar.txt'), []);
$cached = $this->cacheBackend
->get('key');
$this->assertArrayNotHasKey('foo_bar.txt', $cached->data);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.