jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/400687 )
Change subject: Use trivial implementations instead of mocks, if possible
......................................................................
Use trivial implementations instead of mocks, if possible
Mocking everything can easily become an anti-pattern. In the cases
touched in this patch we do have very trivial (in-memory) implementations
that work just fine. This makes the test setup easier to read.
Change-Id: I93fef5246767cab1b0d912df3f94c7ce0e18eb4f
---
M tests/phpunit/mediawiki/Content/MediaInfoHandlerTest.php
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Ladsgroup: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/phpunit/mediawiki/Content/MediaInfoHandlerTest.php
b/tests/phpunit/mediawiki/Content/MediaInfoHandlerTest.php
index 55c23b4..92835ba 100644
--- a/tests/phpunit/mediawiki/Content/MediaInfoHandlerTest.php
+++ b/tests/phpunit/mediawiki/Content/MediaInfoHandlerTest.php
@@ -12,7 +12,7 @@
use RequestContext;
use Title;
use Wikibase\DataModel\Entity\EntityId;
-use Wikibase\DataModel\Entity\EntityIdParser;
+use Wikibase\DataModel\Entity\ItemIdParser;
use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup;
use Wikibase\Lib\Store\EntityContentDataCodec;
use Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookupFactory;
@@ -85,7 +85,7 @@
$this->getMockWithoutConstructor(
EntityContentDataCodec::class ),
$this->getMockWithoutConstructor(
EntityConstraintProvider::class ),
$this->getMock( ValidatorErrorLocalizer::class ),
- $this->getMock( EntityIdParser::class ),
+ new ItemIdParser(),
$this->getMock( EntityIdLookup::class ),
$labelLookupFactory,
$missingMediaInfoHandler,
--
To view, visit https://gerrit.wikimedia.org/r/400687
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I93fef5246767cab1b0d912df3f94c7ce0e18eb4f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseMediaInfo
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Lucas Werkmeister (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits