Avoid "Unable to set value to APCBagOStuff" exceptions
[lhc/web/wiklou.git] / tests / phpunit / includes / libs / objectcache / BagOStuffTest.php
index 94b74cb..b9fd6ab 100644 (file)
@@ -183,6 +183,18 @@ class BagOStuffTest extends MediaWikiTestCase {
                $this->assertEquals( $expectedValue, $actualValue, 'Value should be 1 after incrementing' );
        }
 
+       /**
+        * @covers BagOStuff::incrWithInit
+        */
+       public function testIncrWithInit() {
+               $key = wfMemcKey( 'test' );
+               $val = $this->cache->incrWithInit( $key, 0, 1, 3 );
+               $this->assertEquals( 3, $val, "Correct init value" );
+
+               $val = $this->cache->incrWithInit( $key, 0, 1, 3 );
+               $this->assertEquals( 4, $val, "Correct init value" );
+       }
+
        /**
         * @covers BagOStuff::getMulti
         */