Hygiene: Replace QuickTemplate test subclass with mock

Change-Id: I32aa9d5103f4b6790a5118d5cad2cd91d3ddc459
This commit is contained in:
Timo Tijhof 2018-02-02 17:27:28 -08:00 committed by Krinkle
parent f2048cd92d
commit d5145178b9

View File

@ -14,11 +14,6 @@ use Title;
use User; use User;
use Wikimedia\TestingAccessWrapper; use Wikimedia\TestingAccessWrapper;
class Template extends QuickTemplate {
public function execute() {
}
}
class EchoNotifUser { class EchoNotifUser {
public function __construct( public function __construct(
$lastUnreadAlertTime, $lastUnreadMessageTime, $echoNotificationCount $lastUnreadAlertTime, $lastUnreadMessageTime, $echoNotificationCount
@ -268,7 +263,9 @@ class SkinMinervaTest extends MediaWikiTestCase {
->method( 'getFormattedEchoNotificationCount' ) ->method( 'getFormattedEchoNotificationCount' )
->will( $this->returnValue( $formattedEchoNotificationCount ) ); ->will( $this->returnValue( $formattedEchoNotificationCount ) );
$tpl = new Template(); $tpl = $this->getMockBuilder( QuickTemplate::class )
->setMethods( [ 'execute' ] )
->getMock();
$skin->prepareUserButton( $tpl ); $skin->prepareUserButton( $tpl );
$this->assertEquals( $this->assertEquals(
$expectedSecondaryButtonData, $expectedSecondaryButtonData,