Commit 626f64d8 authored by alexpott's avatar alexpott

Revert "Issue #2492429 by mikeryan: Migration count caching broken"

This reverts commit c523c995.
parent 4b12bbf0
......@@ -423,7 +423,7 @@ public function count($refresh = FALSE) {
// class to get the count from the source.
if ($refresh || !$this->cacheCounts) {
$count = $this->getIterator()->count();
$this->getCache()->set($this->cacheKey, $count);
$this->getCache()->set($this->cacheKey, $count, 'cache');
}
else {
// Caching is in play, first try to retrieve a cached count.
......@@ -436,7 +436,7 @@ public function count($refresh = FALSE) {
// No cached count, ask the derived class to count 'em up, and cache
// the result.
$count = $this->getIterator()->count();
$this->getCache()->set($this->cacheKey, $count);
$this->getCache()->set($this->cacheKey, $count, 'cache');
}
}
return $count;
......
......@@ -139,12 +139,10 @@ public function testHighwaterTrackChangesIncompatible() {
* Test that the source count is correct.
*/
public function testCount() {
// Use the Apcu cache backend, which confirms that the cache API is being
// properly used.
$container = new ContainerBuilder();
$cache_tags_checksum = $this->getMock('\Drupal\Core\Cache\CacheTagsChecksumInterface');
$container->register('cache.migrate', 'Drupal\Core\Cache\ApcuBackend')
->setArguments(['migrate', 'migrate', $cache_tags_checksum]);
$container->register('cache.migrate', 'Drupal\Core\Cache\NullBackend')
->setArguments(['migrate']);
\Drupal::setContainer($container);
// Test that the basic count works.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment