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

Change subject: Do not run ParserAfterParse client hook during phpunit tests
......................................................................


Do not run ParserAfterParse client hook during phpunit tests

It interferes with tests that parse something, with
trying to access repo site link table.

Change-Id: Id2ae5eb741b7531c5a43b1499b14ae9272defabf
---
M client/WikibaseClient.hooks.php
1 file changed, 6 insertions(+), 0 deletions(-)

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



diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index 15318dd..6ee65e2 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -329,6 +329,12 @@
         * @return bool
         */
        public static function onParserAfterParse( Parser &$parser, &$text, 
StripState $stripState ) {
+               // this hook tries to access repo SiteLinkTable
+               // it interferes with any test that parses something, like a 
page or a message
+               if ( defined( 'MW_PHPUNIT_TEST' ) ) {
+                       return true;
+               }
+
                wfProfileIn( __METHOD__ );
 
                // @todo split up the multiple responsibilities here and in 
lang link handler

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id2ae5eb741b7531c5a43b1499b14ae9272defabf
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to