Thiemo Mättig (WMDE) has uploaded a new change for review. (
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(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseLexeme
refs/changes/39/347339/1
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: newchange
Gerrit-Change-Id: I0fc1a70897d41c7cff66bdc285ec444a7111a247
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseLexeme
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits