File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
src/Symfony/Component/Cache Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ public function __construct()
2828 self ::$ createCacheItem ??= \Closure::bind (
2929 static function ($ key ) {
3030 $ item = new CacheItem ();
31+ $ item ->isTaggable = true ;
3132 $ item ->key = $ key ;
3233 $ item ->isHit = false ;
3334
Original file line number Diff line number Diff line change @@ -138,6 +138,15 @@ public function testCommit()
138138 $ this ->assertTrue ($ this ->createCachePool ()->commit ());
139139 }
140140
141+ public function testTaggable ()
142+ {
143+ $ this ->expectNotToPerformAssertions ();
144+ $ adapter = $ this ->createCachePool ();
145+ $ item = $ adapter ->getItem ('any_item ' );
146+ // No error triggered 'Cache item "%s" comes from a non tag-aware pool: you cannot tag it.'
147+ $ item ->tag (['tag1 ' ]);
148+ }
149+
141150 public function testInvalidateTags ()
142151 {
143152 $ adapter = $ this ->createCachePool ();
You can’t perform that action at this time.
0 commit comments