Esempio n. 1
0
 /**
  * Direct delete instruction. Registry will be stored
  * @see lib/ezc/Cache/src/storage/ezcCacheStorageMemory::delete()
  */
 public function delete($id = null, $attributes = array(), $search = false)
 {
     $this->forceStoreRegistry = true;
     parent::delete($id, $attributes, $search);
 }
 public function testStorageOptions()
 {
     $storageOptions = new ezcCacheStorageOptions();
     $storageApcOptions = new ezcCacheStorageApcOptions();
     $arrayOptions = array();
     $storage = new ezcCacheStorageApcPlain('.', array());
     $storage->reset();
     $storage->setOptions($storageApcOptions);
     $this->assertEquals($storageApcOptions, $storage->getOptions());
     $storage->options = $storageApcOptions;
     $this->assertEquals($storageApcOptions, $storage->getOptions());
     $storage->setOptions($storageOptions);
     $this->assertEquals($storageApcOptions, $storage->getOptions());
     $storage->options = $storageOptions;
     $this->assertEquals($storageApcOptions, $storage->getOptions());
     $storage->setOptions($arrayOptions);
     $this->assertEquals($storageApcOptions, $storage->getOptions());
     $storage->options = $arrayOptions;
     $this->assertEquals($storageApcOptions, $storage->getOptions());
     $options = new stdClass();
     try {
         $storage->setOptions($options);
         $this->fail("Expected exception was not thrown.");
     } catch (ezcBaseValueException $e) {
         $this->assertEquals("The value 'O:8:\"stdClass\":0:{}' that you were trying to " . "assign to setting 'options' is invalid. Allowed values " . "are: instance of ezcCacheStorageApcOptions.", $e->getMessage());
     }
 }