jenkins-bot has submitted this change and it was merged.

Change subject: Better handling of Titles in tests
......................................................................


Better handling of Titles in tests

Clear cache or use mock. This is necessary for me to get the tests passing
again.

Change-Id: I31e738dd23beff9c0e0e4daec1e12309948308ac
---
M repo/tests/phpunit/includes/Diff/EntityContentDiffViewTest.php
M repo/tests/phpunit/includes/RepoHooksTest.php
2 files changed, 4 insertions(+), 2 deletions(-)

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



diff --git a/repo/tests/phpunit/includes/Diff/EntityContentDiffViewTest.php 
b/repo/tests/phpunit/includes/Diff/EntityContentDiffViewTest.php
index 26cb327..496bdee 100644
--- a/repo/tests/phpunit/includes/Diff/EntityContentDiffViewTest.php
+++ b/repo/tests/phpunit/includes/Diff/EntityContentDiffViewTest.php
@@ -106,11 +106,11 @@
 
                $redirectContent = ItemContent::newFromRedirect(
                        $redirect,
-                       Title::newFromText( 
$redirect->getEntityId()->getSerialization() )
+                       $this->getMock( Title::class )
                );
                $redirectContent2 = ItemContent::newFromRedirect(
                        $redirect2,
-                       Title::newFromText( 
$redirect2->getEntityId()->getSerialization() )
+                       $this->getMock( Title::class )
                );
 
                return array(
diff --git a/repo/tests/phpunit/includes/RepoHooksTest.php 
b/repo/tests/phpunit/includes/RepoHooksTest.php
index c366df0..5ab23f0 100644
--- a/repo/tests/phpunit/includes/RepoHooksTest.php
+++ b/repo/tests/phpunit/includes/RepoHooksTest.php
@@ -9,6 +9,7 @@
 use OutputPage;
 use ParserOutput;
 use RequestContext;
+use Title;
 use Wikibase\Repo\WikibaseRepo;
 use Wikibase\RepoHooks;
 use WikiImporter;
@@ -37,6 +38,7 @@
 
        protected function tearDown() {
                WikibaseRepo::getDefaultInstance()->getSettings()->setSetting( 
'allowEntityImport', $this->saveAllowImport );
+               Title::clearCaches();
 
                parent::tearDown();
        }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I31e738dd23beff9c0e0e4daec1e12309948308ac
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Adrian Heine <[email protected]>
Gerrit-Reviewer: Adrian Heine <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to