Merge "phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat"
[lhc/web/wiklou.git] / tests / phpunit / maintenance / MaintenanceTest.php
index bd10856..6b0e344 100644 (file)
@@ -5,6 +5,7 @@
 // without changing the visibility and without working around hacks in
 // Maintenance.php
 // For the same reason, we cannot just use FakeMaintenance.
+use MediaWiki\MediaWikiServices;
 
 /**
  * makes parts of the API of Maintenance that is hidden by protected visibily
@@ -23,7 +24,6 @@
  * Due to a hack in Maintenance.php using register_shutdown_function, be sure to
  * finally call simulateShutdown on MaintenanceFixup instance before a test
  * ends.
- *
  */
 class MaintenanceFixup extends Maintenance {
 
@@ -826,7 +826,7 @@ class MaintenanceTest extends MediaWikiTestCase {
        public function testGetConfig() {
                $this->assertInstanceOf( 'Config', $this->m->getConfig() );
                $this->assertSame(
-                       ConfigFactory::getDefaultInstance()->makeConfig( 'main' ),
+                       MediaWikiServices::getInstance()->getMainConfig(),
                        $this->m->getConfig()
                );
        }
@@ -835,7 +835,7 @@ class MaintenanceTest extends MediaWikiTestCase {
         * @covers Maintenance::setConfig
         */
        public function testSetConfig() {
-               $conf = $this->getMock( 'Config' );
+               $conf = $this->createMock( 'Config' );
                $this->m->setConfig( $conf );
                $this->assertSame( $conf, $this->m->getConfig() );
        }