use MediaWiki\Logger\LoggerFactory;
use MediaWiki\MediaWikiServices;
use Psr\Log\LoggerInterface;
+use Wikimedia\Rdbms\LoadBalancer;
/**
* @covers MediaWikiTestCase
+ * @group MediaWikiTestCaseTest
+ *
* @author Addshore
*/
class MediaWikiTestCaseTest extends MediaWikiTestCase {
*/
public function testLoggersAreRestoredOnTearDown_replacingExistingLogger() {
$logger1 = LoggerFactory::getInstance( 'foo' );
- $this->setLogger( 'foo', $this->getMock( LoggerInterface::class ) );
+ $this->setLogger( 'foo', $this->createMock( LoggerInterface::class ) );
$logger2 = LoggerFactory::getInstance( 'foo' );
$this->tearDown();
$logger3 = LoggerFactory::getInstance( 'foo' );
* @covers MediaWikiTestCase::restoreLoggers
*/
public function testLoggersAreRestoredOnTearDown_replacingNonExistingLogger() {
- $this->setLogger( 'foo', $this->getMock( LoggerInterface::class ) );
+ $this->setLogger( 'foo', $this->createMock( LoggerInterface::class ) );
$logger1 = LoggerFactory::getInstance( 'foo' );
$this->tearDown();
$logger2 = LoggerFactory::getInstance( 'foo' );
*/
public function testLoggersAreRestoredOnTearDown_replacingSameLoggerTwice() {
$logger1 = LoggerFactory::getInstance( 'baz' );
- $this->setLogger( 'foo', $this->getMock( LoggerInterface::class ) );
- $this->setLogger( 'foo', $this->getMock( LoggerInterface::class ) );
+ $this->setLogger( 'foo', $this->createMock( LoggerInterface::class ) );
+ $this->setLogger( 'foo', $this->createMock( LoggerInterface::class ) );
$this->tearDown();
$logger2 = LoggerFactory::getInstance( 'baz' );