Example #1
0
 public function testCanConstructMediaWikiCache()
 {
     if (!class_exists('\\BagOstuff')) {
         $this->markTestSkipped('BagOstuff interface is not available');
     }
     $cache = $this->getMockBuilder('\\BagOstuff')->disableOriginalConstructor()->getMockForAbstractClass();
     $instance = new CacheFactory();
     $this->assertInstanceOf('\\Onoi\\Cache\\MediaWikiCache', $instance->newMediaWikiCache($cache));
 }
 protected function setUp()
 {
     $cache = array();
     $cacheFactory = new CacheFactory();
     $cache[] = $cacheFactory->newFixedInMemoryLruCache();
     if (class_exists('\\HashBagOStuff')) {
         $cache[] = $cacheFactory->newMediaWikiCache(new HashBagOStuff());
     }
     if (class_exists('\\Doctrine\\Common\\Cache\\ArrayCache')) {
         $cache[] = $cacheFactory->newDoctrineCache(new ArrayCache());
     }
     $this->cache = $cacheFactory->newCompositeCache($cache);
 }