Merge "objectcache: defined some missing methods in MultiWriteBagOStuff"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 27 Mar 2019 18:34:30 +0000 (18:34 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 27 Mar 2019 18:34:30 +0000 (18:34 +0000)
1  2 
tests/phpunit/includes/libs/objectcache/BagOStuffTest.php

@@@ -16,7 -16,7 +16,7 @@@ class BagOStuffTest extends MediaWikiTe
                parent::setUp();
  
                // type defined through parameter
 -              if ( $this->getCliArg( 'use-bagostuff' ) ) {
 +              if ( $this->getCliArg( 'use-bagostuff' ) !== null ) {
                        $name = $this->getCliArg( 'use-bagostuff' );
  
                        $this->cache = ObjectCache::newFromId( $name );
                        $this->cache->merge( $key, $callback, 5, 1 ),
                        'Non-blocking merge (CAS)'
                );
-               $this->assertEquals( 1, $calls );
+               if ( $this->cache instanceof MultiWriteBagOStuff ) {
+                       $wrapper = \Wikimedia\TestingAccessWrapper::newFromObject( $this->cache );
+                       $n = count( $wrapper->caches );
+               } else {
+                       $n = 1;
+               }
+               $this->assertEquals( $n, $calls );
        }
  
        /**