public function testPurgeLimit() { $storage = new ezcCacheStorageFileApcArray($this->getTempDir(__CLASS__), array('ttl' => 1)); $storage->reset(); $data = array('ID', 'Some/Dir/ID', 'Some/other/Dir/ID/1', 'Some/other/Dir/ID/2', 'Some/other/Dir/ID/3'); foreach ($data as $id) { $storage->store($id, $id); } // Outdate usleep(1000002); $purgedIds = $storage->purge(3); $this->assertEquals(array('ID', 'Some/Dir/ID', 'Some/other/Dir/ID/1'), $purgedIds, 'Purged IDs not returned correctly.'); $this->removeTempDir(); }