wiki.techinc.nl/tests/phpunit/unit/includes/parser/ParserCacheFactoryTest.php
Petr Pchelko fec48eb5a4 Create ParserCacheFactory.
* Makes ParserCache take the root of the key
  as a constructor argument
* Introduces a ParserCacheFactory

Next steps:
- convert FlaggedRevs to using this.
- cleanup

This assumes that we wouldn't want to differentiate
the parser cache settings per use-case, as it is now
for default vs flaggedrevs caches. There are only two settings:
$wgParserCacheType - name of the BagOStuff to use
$wgParserCacheExpireTime - the expiration time.
I think if we wanted to have different settings for different
caches, we could add that as a next step.

Bug: T263583
Change-Id: I188772da541a95c95a5ecece7c7dd748395506c2
2020-09-25 18:17:58 -07:00

32 lines
630 B
PHP

<?php
use MediaWiki\Parser\ParserCacheFactory;
/**
* @covers \MediaWiki\Parser\ParserCacheFactory
*/
class ParserCacheFactoryTest extends MediaWikiUnitTestCase {
use FactoryArgTestTrait;
protected static function getFactoryClass() {
return ParserCacheFactory::class;
}
protected static function getInstanceClass() {
return ParserCache::class;
}
protected static function getFactoryMethodName() {
return 'getInstance';
}
protected static function getExtraClassArgCount() {
// +1 $name
// -1 $logger
return 0;
}
protected function getIgnoredParamNames() {
return [ 'hookContainer', 'logger' ];
}
}