示例#1
0
 public function test_buildKey()
 {
     $prefix = 'prefix';
     $key = 'z123';
     $apc = new ApcCache(['keyPrefix' => $prefix]);
     $this->assertEquals($prefix . $key, $apc->buildKey($key));
     //string
     $this->assertEquals($prefix . $key . ':' . md5($key), $apc->buildKey([$key]));
     //array
 }
示例#2
0
 public function test_buildKey()
 {
     if (!extension_loaded('apcu')) {
         $this->markTestSkipped('APCu module is not loaded');
     }
     $prefix = 'prefix';
     $key = 'z123';
     $apc = new ApcCache(['keyPrefix' => $prefix]);
     $this->assertEquals($prefix . $key, $apc->buildKey($key));
     //string
     $this->assertEquals($prefix . $key . ':' . md5($key), $apc->buildKey([$key]));
     //array
 }