public function testClearByPrefixThrowsInvalidArgumentExceptionOnEmptyPrefix() { if (!$this->_storage instanceof ClearByPrefixInterface) { $this->markTestSkipped("Storage doesn't implement ClearByPrefixInterface"); } $this->setExpectedException('Zend\\Cache\\Exception\\InvalidArgumentException'); $this->_storage->clearByPrefix(''); }
public function testClearByPrefix() { if (!$this->_storage instanceof ClearByPrefixInterface) { $this->markTestSkipped("Storage doesn't implement ClearByPrefixInterface"); } $this->assertSame(array(), $this->_storage->setItems(array('key1' => 'value1', 'key2' => 'value2', 'test' => 'value'))); $this->assertTrue($this->_storage->clearByPrefix('key')); $this->assertFalse($this->_storage->hasItem('key1')); $this->assertFalse($this->_storage->hasItem('key2')); $this->assertTrue($this->_storage->hasItem('test')); }