2012-10-01 14:05:22 +00:00
|
|
|
<?php
|
2016-09-29 08:16:05 +00:00
|
|
|
|
2012-10-01 14:05:22 +00:00
|
|
|
/**
|
2015-08-21 21:03:48 +00:00
|
|
|
* @group BagOStuff
|
2019-07-11 12:35:07 +00:00
|
|
|
* @covers BagOStuff
|
2012-10-01 14:05:22 +00:00
|
|
|
*/
|
2020-06-03 02:34:08 +00:00
|
|
|
class BagOStuffTest extends BagOStuffTestBase {
|
|
|
|
|
protected function newCacheInstance() {
|
2019-03-27 00:05:48 +00:00
|
|
|
if ( $this->getCliArg( 'use-bagostuff' ) !== null ) {
|
2019-08-13 00:46:14 +00:00
|
|
|
global $wgObjectCaches;
|
2012-10-01 14:05:22 +00:00
|
|
|
|
2019-08-13 00:46:14 +00:00
|
|
|
$id = $this->getCliArg( 'use-bagostuff' );
|
2020-06-03 02:34:08 +00:00
|
|
|
$cache = ObjectCache::newFromParams( $wgObjectCaches[$id] );
|
2012-10-01 14:05:22 +00:00
|
|
|
} else {
|
2013-02-15 10:24:31 +00:00
|
|
|
// no type defined - use simple hash
|
2020-06-03 02:34:08 +00:00
|
|
|
$cache = new HashBagOStuff;
|
2019-03-08 01:53:39 +00:00
|
|
|
}
|
|
|
|
|
|
2020-06-03 02:34:08 +00:00
|
|
|
return $cache;
|
2019-03-08 01:53:39 +00:00
|
|
|
}
|
2012-10-01 14:05:22 +00:00
|
|
|
}
|