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

Commit

Permalink
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Storage/Adapter/KeyListIterator.php
Expand Up @@ -165,6 +165,6 @@ public function rewind()
*/
public function count()
{
return $this->count();
return $this->count;
}
}
33 changes: 33 additions & 0 deletions test/Storage/Adapter/KeyListIteratorTest.php
@@ -0,0 +1,33 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Cache
*/

namespace ZendTest\Cache\Storage\Adapter;

use Zend\Cache;
use Zend\Cache\Storage\Adapter\Memory as MemoryStorage;
use Zend\Cache\Storage\Adapter\KeyListIterator;

/**
* @category Zend
* @package Zend_Cache
* @subpackage UnitTests
* @group Zend_Cache
*/
class KeyListIteratorTest extends \PHPUnit_Framework_TestCase
{

public function testCount()
{
$keys = array('key1', 'key2', 'key3');
$storage = $this->getMock('Zend\Cache\Storage\StorageInterface');
$iterator = new KeyListIterator($storage, $keys);
$this->assertEquals(3, $iterator->count());
}
}

0 comments on commit 5077dc6

Please sign in to comment.