10 use MediaWikiCoversValidator;
20 $backend->set(
'foo',
'bar' );
23 $backend->set(
'foo',
'baz' );
35 for ( $i = 0; $i < 10; $i++ ) {
54 $cache->set(
'foo',
'bar', 0, CachedBagOStuff::WRITE_CACHE_ONLY );
58 $cache->set(
'foo',
'old' );
62 $cache->set(
'foo',
'new', 0, CachedBagOStuff::WRITE_CACHE_ONLY );
66 $cache->delete(
'foo', CachedBagOStuff::WRITE_CACHE_ONLY );
81 $backend->set(
'foo',
true );
87 $backend->set(
'bar',
true );
98 $backend = TestingAccessWrapper::newFromObject( $backend );
105 $this->
assertTrue( $backend->debugMode,
'sets backend' );
114 ->setMethods( [
'deleteObjectsExpiringBefore' ] )
116 $backend->expects( $this->
once() )
117 ->method(
'deleteObjectsExpiringBefore' )
118 ->willReturn(
false );
121 $cache->deleteObjectsExpiringBefore(
'20110401000000' );
129 ->setMethods( [
'makeKey' ] )
131 $backend->method(
'makeKey' )
132 ->willReturn(
'special/logic' );
140 $this->
assertEquals(
'special/logic', $backend->makeKey(
'special',
'logic' ) );
149 ->setMethods( [
'makeGlobalKey' ] )
151 $backend->method(
'makeGlobalKey' )
152 ->willReturn(
'special/logic' );
156 $this->
assertEquals(
'special/logic', $backend->makeGlobalKey(
'special',
'logic' ) );
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
testMakeKey()
CachedBagOStuff::makeKey.
testExpire()
CachedBagOStuff::deleteObjectsExpiringBefore.
testSetDebug()
CachedBagOStuff::setDebug.
testCacheBackendMisses()
CachedBagOStuff::get.
testMakeGlobalKey()
CachedBagOStuff::makeGlobalKey.
testSetAndDelete()
CachedBagOStuff::set CachedBagOStuff::delete.
testWriteCacheOnly()
CachedBagOStuff::set CachedBagOStuff::delete.
testGetFromBackend()
CachedBagOStuff::__construct CachedBagOStuff::get.
Wrapper around a BagOStuff that caches data in memory.
Simple store for keeping values in an associative array for the current process.