function CachePreWarmerTest::testPreWarmByOne

@covers ::preWarmOneCache

File

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

Class

CachePreWarmerTest
@coversDefaultClass \Drupal\Core\PreWarm\CachePreWarmer @group PreWarm

Namespace

Drupal\Tests\Core\PreWarm

Code

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

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