Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge branch 'weierophinney-hotfix/cache-dba-inifile'
Browse files Browse the repository at this point in the history
  • Loading branch information
ezimuel committed Feb 26, 2015
2 parents eb58777 + ae27de7 commit 1419dce
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
6 changes: 6 additions & 0 deletions library/Zend/Cache/Storage/Adapter/DbaOptions.php
Expand Up @@ -117,6 +117,12 @@ public function setHandler($handler)
throw new Exception\ExtensionNotLoadedException("DBA-Handler '{$handler}' not supported");
}

if ($handler === 'inifile') {
throw new Exception\ExtensionNotLoadedException(
"DBA-Handler 'inifile' does not reliably support write operations"
);
}

$this->triggerOptionEvent('handler', $handler);
$this->handler = $handler;
return $this;
Expand Down
13 changes: 11 additions & 2 deletions tests/ZendTest/Cache/Storage/Adapter/DbaInifileTest.php
Expand Up @@ -9,11 +9,20 @@

namespace ZendTest\Cache\Storage\Adapter;

use PHPUnit_Framework_TestCase as TestCase;
use Zend\Cache\Storage\Adapter\Dba;

/**
* @group Zend_Cache
*/
class DbaInifileTest extends AbstractDbaTest
class DbaInifileTest extends TestCase
{
protected $handler = 'inifile';
public function testSpecifyingInifileHandlerRaisesException()
{
$this->setExpectedException('Zend\Cache\Exception\ExtensionNotLoadedException', 'inifile');
$cache = new Dba(array(
'pathname' => sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid('zfcache_dba_') . '.inifile',
'handler' => 'inifile',
));
}
}

0 comments on commit 1419dce

Please sign in to comment.