objectcache: make MultiWriteBagOStuff handle duplicate add() operations
[lhc/web/wiklou.git] / tests / phpunit / includes / libs / objectcache / MultiWriteBagOStuffTest.php
index 4a9f6cc..8a95ae7 100644 (file)
@@ -137,4 +137,13 @@ class MultiWriteBagOStuffTest extends MediaWikiTestCase {
 
                $this->assertSame( 'special', $cache->makeGlobalKey( 'a', 'b' ) );
        }
+
+       public function testDuplicateStoreAdd() {
+               $bag = new HashBagOStuff();
+               $cache = new MultiWriteBagOStuff( [
+                       'caches' => [ $bag, $bag ],
+               ] );
+
+               $this->assertTrue( $cache->add( 'key', 1, 30 ) );
+       }
 }