public function testInRequestCacheLimit()
 {
     $cache = new PhutilInRequestKeyValueCache();
     $cache->setLimit(4);
     $cache->setKey(1, 1);
     $cache->setKey(2, 2);
     $cache->setKey(3, 3);
     $cache->setKey(4, 4);
     $this->assertEqual(array(1 => 1, 2 => 2, 3 => 3, 4 => 4), $cache->getAllKeys());
     $cache->setKey(5, 5);
     $this->assertEqual(array(2 => 2, 3 => 3, 4 => 4, 5 => 5), $cache->getAllKeys());
 }
 private static function buildRepositoryGraphL1Caches()
 {
     $caches = array();
     $request = new PhutilInRequestKeyValueCache();
     $request->setLimit(32);
     $caches[] = $request;
     $apc = new PhutilAPCKeyValueCache();
     if ($apc->isAvailable()) {
         $caches[] = $apc;
     }
     return $caches;
 }