public function testCountDataItems() { $storage1 = $this->getMock('ezcCacheStackableStorage', array('reset', 'purge', 'countDataItems')); $storage1->expects($this->once())->method('countDataItems')->with('foo', array())->will($this->returnValue(2)); $storage2 = $this->getMock('ezcCacheStackableStorage', array('reset', 'purge', 'countDataItems')); $storage2->expects($this->once())->method('countDataItems')->with('foo', array())->will($this->returnValue(1)); $stack = new ezcCacheStack('foo'); $stack->pushStorage(new ezcCacheStackStorageConfiguration('id_1', $storage1, 10, 0.5)); $stack->pushStorage(new ezcCacheStackStorageConfiguration('id_2', $storage2, 100, 0.7)); $this->assertEquals(3, $stack->countDataItems('foo')); }