// 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
* 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 {
public function testGetConfig() {
$this->assertInstanceOf( 'Config', $this->m->getConfig() );
$this->assertSame(
- ConfigFactory::getDefaultInstance()->makeConfig( 'main' ),
+ MediaWikiServices::getInstance()->getMainConfig(),
$this->m->getConfig()
);
}
* @covers Maintenance::setConfig
*/
public function testSetConfig() {
- $conf = $this->getMock( 'Config' );
+ $conf = $this->createMock( 'Config' );
$this->m->setConfig( $conf );
$this->assertSame( $conf, $this->m->getConfig() );
}