jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/347339 )

Change subject: Do not use getMockBuilder() on interfaces
......................................................................


Do not use getMockBuilder() on interfaces

Same as I1cc80b9.

Interfaces do not have constructors, no need for disableOriginalConstructor(). 
;-)
I found these with two regular expressions. The first extracted all interface
names in my local code base, the second found getMockBuilder() calls with these
interfaces.

Change-Id: I0fc1a70897d41c7cff66bdc285ec444a7111a247
---
M tests/phpunit/mediawiki/View/LexemeViewTest.php
1 file changed, 3 insertions(+), 6 deletions(-)

Approvals:
  Ladsgroup: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/phpunit/mediawiki/View/LexemeViewTest.php 
b/tests/phpunit/mediawiki/View/LexemeViewTest.php
index aeafdab..f4c9605 100644
--- a/tests/phpunit/mediawiki/View/LexemeViewTest.php
+++ b/tests/phpunit/mediawiki/View/LexemeViewTest.php
@@ -87,9 +87,8 @@
         * @return LabelDescriptionLookup
         */
        private function newLabelDescriptionLookup() {
-               $labelDescriptionLookup = $this->getMockBuilder( 
LabelDescriptionLookup::class )
-                       ->disableOriginalConstructor()
-                       ->getMock();
+               $labelDescriptionLookup = $this->getMock( 
LabelDescriptionLookup::class );
+
                $labelDescriptionLookup
                        ->method( 'getLabel' )
                        ->will(
@@ -108,9 +107,7 @@
         * @return EntityTermsView
         */
        private function newEntityTermsViewMock() {
-               $entityTermsView = $this->getMockBuilder( 
EntityTermsView::class )
-                       ->disableOriginalConstructor()
-                       ->getMock();
+               $entityTermsView = $this->getMock( EntityTermsView::class );
 
                $entityTermsView->expects( $this->never() )
                        ->method( 'getHtml' );

-- 
To view, visit https://gerrit.wikimedia.org/r/347339
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0fc1a70897d41c7cff66bdc285ec444a7111a247
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseLexeme
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Aleksey Bekh-Ivanov (WMDE) <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Jonas Kress (WMDE) <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to