From d5145178b97b684e97e3a57d6b6fa2b72b1b374b Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 2 Feb 2018 17:27:28 -0800 Subject: [PATCH] Hygiene: Replace QuickTemplate test subclass with mock Change-Id: I32aa9d5103f4b6790a5118d5cad2cd91d3ddc459 --- tests/phpunit/skins/SkinMinervaTest.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/skins/SkinMinervaTest.php b/tests/phpunit/skins/SkinMinervaTest.php index 8de74ec..5ce3aca 100644 --- a/tests/phpunit/skins/SkinMinervaTest.php +++ b/tests/phpunit/skins/SkinMinervaTest.php @@ -14,11 +14,6 @@ use Title; use User; use Wikimedia\TestingAccessWrapper; -class Template extends QuickTemplate { - public function execute() { - } -} - class EchoNotifUser { public function __construct( $lastUnreadAlertTime, $lastUnreadMessageTime, $echoNotificationCount @@ -268,7 +263,9 @@ class SkinMinervaTest extends MediaWikiTestCase { ->method( 'getFormattedEchoNotificationCount' ) ->will( $this->returnValue( $formattedEchoNotificationCount ) ); - $tpl = new Template(); + $tpl = $this->getMockBuilder( QuickTemplate::class ) + ->setMethods( [ 'execute' ] ) + ->getMock(); $skin->prepareUserButton( $tpl ); $this->assertEquals( $expectedSecondaryButtonData,