minor #19474 [Cache] Fix abstract AdapterTestCase cache property (tgalopin)
This PR was submitted for the master branch but it was merged into the 3.1 branch instead (closes #19474).
Discussion
----------
[Cache] Fix abstract AdapterTestCase cache property
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | Sort of
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | reference to the documentation PR, if any
The `AdapterTestCase` extends the `CachePoolTest` from the [cache/integration-tests package](https://packagist.org/packages/cache/integration-tests) in order to test cache pools but it tries to reuse a private variable from its parent class.
As there is no need to use a property in this case, I simply replace the variable by a local one.
Commits
-------
348b335
[Cache] Fix abstract AdapterTestCase cache property
This commit is contained in:
commit
b1fb82d6db
@ -23,18 +23,18 @@ abstract class AdapterTestCase extends CachePoolTest
|
||||
return;
|
||||
}
|
||||
|
||||
$this->cache = $this->createCachePool(2);
|
||||
$cache = $this->createCachePool(2);
|
||||
|
||||
$item = $this->cache->getItem('key.dlt');
|
||||
$item = $cache->getItem('key.dlt');
|
||||
$item->set('value');
|
||||
$this->cache->save($item);
|
||||
$cache->save($item);
|
||||
sleep(1);
|
||||
|
||||
$item = $this->cache->getItem('key.dlt');
|
||||
$item = $cache->getItem('key.dlt');
|
||||
$this->assertTrue($item->isHit());
|
||||
|
||||
sleep(2);
|
||||
$item = $this->cache->getItem('key.dlt');
|
||||
$item = $cache->getItem('key.dlt');
|
||||
$this->assertFalse($item->isHit());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user