wiki.techinc.nl/tests/phpunit/includes/libs/objectcache/BagOStuffTest.php
Aaron Schulz 55d147e4bb objectcache: Split out BagOStuffTestBase class for easier subclassing
Create a simple APCUBagOStuff subclass and also fix
APCUBagOStuff::incrWithInit() default $init value.

Change-Id: If84963fe7dcfedd6edebfb8785235263e0868ece
2020-06-13 20:15:23 +00:00

21 lines
448 B
PHP

<?php
/**
* @group BagOStuff
* @covers BagOStuff
*/
class BagOStuffTest extends BagOStuffTestBase {
protected function newCacheInstance() {
if ( $this->getCliArg( 'use-bagostuff' ) !== null ) {
global $wgObjectCaches;
$id = $this->getCliArg( 'use-bagostuff' );
$cache = ObjectCache::newFromParams( $wgObjectCaches[$id] );
} else {
// no type defined - use simple hash
$cache = new HashBagOStuff;
}
return $cache;
}
}