File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -197,8 +197,7 @@ public function deleteMultiple($keys)
197
197
public function has ($ key )
198
198
{
199
199
$ default = $ this ->defaultValue ;
200
- $ prefix = $ this ->getOptionNamePrefix ();
201
- $ value = $ this ->getOption ("{$ prefix }{$ key }" , $ default );
200
+ $ value = $ this ->get ($ key , $ default );
202
201
203
202
return $ value !== $ default ;
204
203
}
Original file line number Diff line number Diff line change @@ -342,18 +342,16 @@ public function testHas()
342
342
$ defaultValue = uniqid ('default ' );
343
343
$ wpdb = $ this ->createWpdb ();
344
344
$ key = uniqid ('key ' );
345
- $ separator = TestSubject::NAMESPACE_SEPARATOR ;
346
- $ transientName = "{$ poolName }{$ separator }{$ key }" ;
347
- $ optionName = "_transient_ $ transientName " ;
348
345
$ notThereKey = uniqid ('not-there ' );
349
- $ notThereTransientName = "{$ poolName }{$ separator }{$ notThereKey }" ;
350
- $ notThereOptionName = "_transient_ $ notThereTransientName " ;
351
- $ subject = $ this ->createInstance ($ wpdb , $ poolName ,$ defaultValue );
346
+ $ subject = $ this ->createInstance ($ wpdb , $ poolName , $ defaultValue );
352
347
}
353
348
354
349
{
350
+ Functions \expect ('get_transient ' )
351
+ ->andReturnValues ([uniqid ('value ' ), false ]);
352
+
355
353
Functions \expect ('get_option ' )
356
- ->andReturnValues ([uniqid ( ' value ' ), $ defaultValue ]);
354
+ ->andReturnValues ([$ defaultValue ]);
357
355
}
358
356
359
357
{
You can’t perform that action at this time.
0 commit comments