HEX
Server: Apache
System: Linux sg241.singhost.net 2.6.32-896.16.1.lve1.4.51.el6.x86_64 #1 SMP Wed Jan 17 13:19:23 EST 2018 x86_64
User: honghock (909)
PHP: 8.0.30
Disabled: passthru,system,shell_exec,show_source,exec,popen,proc_open
Upload Files
File: //usr/local/lib/php/tests/Cache_Lite/tests/pearbug13693.phpt
--TEST--
pearbug13693
--FILE--
<?php
require_once __DIR__ . '/bootstrap.php';
require_once __DIR__ . '/../Cache/Lite.php';

// Create temp dir
$dir = dirname( __FILE__ ) . '/' . uniqid();
mkdir($dir);

$options = array(
'cacheDir' => $dir,
'lifeTime' => 60,
);
$id = '#13693';
$cache = new Cache_Lite($options);
$cache->save('stuff', $id);
// Must be true
echo $cache->remove($id) === true ? "OK\n" : "ERROR\n";
// Will return a PEAR Error
echo $cache->remove($id) instanceof PEAR_Error ? "OK\n" : "ERROR\n";
// Will return true
echo $cache->remove($id, 'default', true) === true ? "OK\n" : "ERROR\n";

// Remove temp dir
rmdir($dir);
--EXPECT--
OK
OK
OK