Skip to content

Commit b1fb82d

Browse files
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
2 parents 75ebbf8 + 348b335 commit b1fb82d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ public function testDefaultLifeTime()
2323
return;
2424
}
2525

26-
$this->cache = $this->createCachePool(2);
26+
$cache = $this->createCachePool(2);
2727

28-
$item = $this->cache->getItem('key.dlt');
28+
$item = $cache->getItem('key.dlt');
2929
$item->set('value');
30-
$this->cache->save($item);
30+
$cache->save($item);
3131
sleep(1);
3232

33-
$item = $this->cache->getItem('key.dlt');
33+
$item = $cache->getItem('key.dlt');
3434
$this->assertTrue($item->isHit());
3535

3636
sleep(2);
37-
$item = $this->cache->getItem('key.dlt');
37+
$item = $cache->getItem('key.dlt');
3838
$this->assertFalse($item->isHit());
3939
}
4040
}

0 commit comments

Comments
 (0)