5 protected function setUp() {
19 CACHE_NONE => [
'class' => EmptyBagOStuff::class ],
20 CACHE_DB => [
'class' => SqlBagOStuff::class ],
25 'hash' => [
'class' => HashBagOStuff::class ],
27 $this->
setMwGlobals(
'wgObjectCaches', $arr + $defaults );
32 $this->assertInstanceOf(
34 ObjectCache::newAnything( [] ),
35 'No available types. Fallback to DB'
42 'wgMainCacheType' =>
'hash'
45 $this->assertInstanceOf(
47 ObjectCache::newAnything( [] ),
48 'Use an available type (hash)'
58 $this->assertInstanceOf(
60 ObjectCache::newAnything( [] ),
61 'Use an available type (CACHE_ACCEL)'
76 $this->assertInstanceOf(
78 ObjectCache::newAnything( [] ),
79 'Fallback to DB if available types fall back to Empty'
86 MediaWiki\MediaWikiServices::disableStorageBackend();
97 $this->assertInstanceOf(
98 EmptyBagOStuff::class,
99 ObjectCache::newAnything( [] ),
100 'Fallback to none if available types and DB are unavailable'
107 MediaWiki\MediaWikiServices::disableStorageBackend();
109 $this->assertInstanceOf(
110 EmptyBagOStuff::class,
111 ObjectCache::newAnything( [] ),
112 'No available types or DB. Fallback to none.'
testNewAnythingNoAccelNoDb()
ObjectCache::newAnything.
testNewAnythingHash()
ObjectCache::newAnything.
testNewAnythingNothing()
ObjectCache::newAnything.
testNewAnythingAccel()
ObjectCache::newAnything.
testNewAnythingNothingNoDb()
ObjectCache::newAnything.
testNewAnythingNoAccel()
ObjectCache::newAnything.