Merge "phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat"
[lhc/web/wiklou.git] / tests / phpunit / includes / site / CachingSiteStoreTest.php
index 4305ceb..7e37907 100644 (file)
@@ -64,7 +64,7 @@ class CachingSiteStoreTest extends MediaWikiTestCase {
        public function testSaveSites() {
                $store = new CachingSiteStore( new HashSiteStore(), wfGetMainCache() );
 
-               $sites = array();
+               $sites = [];
 
                $site = new Site();
                $site->setGlobalId( 'ertrywuutr' );
@@ -95,18 +95,15 @@ class CachingSiteStoreTest extends MediaWikiTestCase {
                        ->disableOriginalConstructor()
                        ->getMock();
 
-               // php 5.3 compatibility!
-               $that = $this;
-
                $dbSiteStore->expects( $this->any() )
                        ->method( 'getSite' )
-                       ->will( $this->returnValue( $that->getTestSite() ) );
+                       ->will( $this->returnValue( $this->getTestSite() ) );
 
                $dbSiteStore->expects( $this->any() )
                        ->method( 'getSites' )
-                       ->will( $this->returnCallback( function() use ( $that ) {
+                       ->will( $this->returnCallback( function() {
                                $siteList = new SiteList();
-                               $siteList->setSite( $that->getTestSite() );
+                               $siteList->setSite( $this->getTestSite() );
 
                                return $siteList;
                        } ) );
@@ -151,6 +148,11 @@ class CachingSiteStoreTest extends MediaWikiTestCase {
                $this->assertEquals( 0, $sites->count() );
        }
 
+       /**
+        * @param Site[] $sites
+        *
+        * @return SiteStore
+        */
        private function getHashSiteStore( array $sites ) {
                $siteStore = new HashSiteStore();
                $siteStore->saveSites( $sites );