Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix unit test require. Remove unneeded symlink. Add unit test for com…
…pression.
  • Loading branch information
colinmollenhour committed Mar 12, 2012
1 parent 67e0421 commit 6c2059d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 0 additions & 1 deletion modman
@@ -1,3 +1,2 @@
Cm/Cache/Backend/* app/code/community/Cm/Cache/Backend/
tests/* tests/
lib/* lib/
11 changes: 10 additions & 1 deletion tests/RedisBackendTest.php
Expand Up @@ -7,7 +7,7 @@
require_once 'app/Mage.php';

require_once 'Zend/Cache.php';
require_once 'Zend/Cache/Backend/Redis.php';
require_once 'Cm/Cache/Backend/Redis.php';

/**
* Common tests for backends
Expand All @@ -34,6 +34,8 @@ public function setUp($notag = false)
'database' => '1',
'notMatchingTags' => TRUE,
'force_standalone' => $this->forceStandalone,
'compress_threshold' => 100,
'compression_lib' => 'gzip',
));
$this->_instance->clean(Zend_Cache::CLEANING_MODE_ALL);
parent::setUp($notag);
Expand All @@ -55,6 +57,13 @@ public function testGetWithAnExpiredCacheId()
// not supported
}

public function testCompression()
{
$longString = str_repeat(md5('asd')."\r\n", 50);
$this->assertTrue($this->_instance->save($longString, 'long', array('long')));
$this->assertTrue($this->_instance->load('long') == $longString);
}

public function testExpiredCleanup()
{
$this->assertTrue($this->_instance->clean());
Expand Down

0 comments on commit 6c2059d

Please sign in to comment.