Merge "mediawiki.jqueryMsg: Strip leading colon in wikilinks"
[lhc/web/wiklou.git] / tests / phpunit / includes / objectcache / BagOStuffTest.php
index cde7ed6..b9fe490 100644 (file)
@@ -120,6 +120,23 @@ class BagOStuffTest extends MediaWikiTestCase {
                $this->assertEquals( $this->cache->get( $key ), $value );
        }
 
+       /**
+        * @covers BagOStuff::getWithSetCallback
+        */
+       public function testGetWithSetCallback() {
+               $key = wfMemcKey( 'test' );
+               $value = $this->cache->getWithSetCallback(
+                       $key,
+                       30,
+                       function () {
+                               return 'hello kitty';
+                       }
+               );
+
+               $this->assertEquals( 'hello kitty', $value );
+               $this->assertEquals( $value, $this->cache->get( $key ) );
+       }
+
        /**
         * @covers BagOStuff::incr
         */
@@ -143,8 +160,11 @@ class BagOStuffTest extends MediaWikiTestCase {
 
                $key1 = wfMemcKey( 'test1' );
                $key2 = wfMemcKey( 'test2' );
-               $key3 = wfMemcKey( 'will-%-encode' ); // internally, MemcachedBagOStuffs will encode to will-%25-encode
-               $key4 = wfMemcKey( 'flowdb:flow_ref:wiki:by-source:v3:Parser\'s_"broken"_+_(page)_&_grill:testwiki:1:4.7' );
+               // internally, MemcachedBagOStuffs will encode to will-%25-encode
+               $key3 = wfMemcKey( 'will-%-encode' );
+               $key4 = wfMemcKey(
+                       'flowdb:flow_ref:wiki:by-source:v3:Parser\'s_"broken"_+_(page)_&_grill:testwiki:1:4.7'
+               );
 
                $this->cache->add( $key1, $value1 );
                $this->cache->add( $key2, $value2 );