Exemplo n.º 1
0
 public function testRemovePlugin()
 {
     $this->_adapter->addPlugin($this->_plugin);
     $this->_adapter->removePlugin($this->_plugin);
     // no events should be attached
     $this->assertEquals(0, count($this->_adapter->events()->getEvents()));
 }
Exemplo n.º 2
0
 public function testInternalTriggerExceptionThrowRuntimeException()
 {
     $plugin = new \ZendTest\Cache\Storage\TestAsset\MockPlugin();
     $this->_storage->addPlugin($plugin);
     $params = new \ArrayObject(array('key' => 'key1', 'value' => 'value1'));
     // call protected method
     $method = new \ReflectionMethod(get_class($this->_storage), 'triggerException');
     $method->setAccessible(true);
     $this->setExpectedException('Zend\\Cache\\Exception\\RuntimeException', 'test');
     $method->invokeArgs($this->_storage, array('setItem', $params, new RuntimeException('test')));
 }