function CachePreWarmerTest::testPreWarmAll

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/PreWarm/CachePreWarmerTest.php \Drupal\Tests\Core\PreWarm\CachePreWarmerTest::testPreWarmAll()

Tests pre warm all.

@legacy-covers ::preWarmAllCaches

File

core/tests/Drupal/Tests/Core/PreWarm/CachePreWarmerTest.php, line 107

Class

CachePreWarmerTest
Tests Drupal\Core\PreWarm\CachePreWarmer.

Namespace

Drupal\Tests\Core\PreWarm

Code

public function testPreWarmAll() : void {
  $this->setupCacheServices();
  $preWarmer = new CachePreWarmer($this->classResolver, [
    'service0',
    'service1',
    'service2',
    'service3',
  ]);
  $this->assertTrue($preWarmer->preWarmAllCaches());
  foreach ($this->warmedMap as $service) {
    $this->assertEquals(1, $this->warmedMap[$service]);
  }
  $this->assertFalse($preWarmer->preWarmAllCaches());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.