File tree Expand file tree Collapse file tree
tests/system/Cache/Handlers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -233,12 +233,11 @@ public function getCacheInfo()
233233 */
234234 public function getMetaData (string $ key )
235235 {
236- $ key = static ::validateKey ($ key , $ this ->prefix );
237236 $ value = $ this ->get ($ key );
238237
239238 if ($ value !== null ) {
240239 $ time = Time::now ()->getTimestamp ();
241- $ ttl = $ this ->redis ->ttl ($ key );
240+ $ ttl = $ this ->redis ->ttl (static :: validateKey ( $ key, $ this -> prefix ) );
242241
243242 return [
244243 'expire ' => $ ttl > 0 ? $ time + $ ttl : null ,
Original file line number Diff line number Diff line change 1919 */
2020abstract class AbstractHandlerTest extends CIUnitTestCase
2121{
22- protected $ handler ;
22+ protected BaseHandler $ handler ;
2323 protected static $ key1 = 'key1 ' ;
2424 protected static $ key2 = 'key2 ' ;
2525 protected static $ key3 = 'key3 ' ;
Original file line number Diff line number Diff line change @@ -198,6 +198,16 @@ public function testGetCacheInfo()
198198 $ this ->assertIsArray ($ this ->handler ->getCacheInfo ());
199199 }
200200
201+ public function testGetMetadataNotNull (): void
202+ {
203+ $ this ->handler ->save (self ::$ key1 , 'value ' );
204+
205+ $ metadata = $ this ->handler ->getMetaData (self ::$ key1 );
206+
207+ $ this ->assertNotNull ($ metadata );
208+ $ this ->assertIsArray ($ metadata );
209+ }
210+
201211 public function testIsSupported ()
202212 {
203213 $ this ->assertTrue ($ this ->handler ->isSupported ());
You can’t perform that action at this time.
0 commit comments