From ddbf0c842322b1dc6fc0646fe94ccd42e754c229 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 9 Feb 2007 05:37:44 +0000 Subject: [PATCH] * Add 'ParserTestTables' hook to expand the list of temporary tables copied by the parser test harness; use for extensions which require the presence of other tables while they work. --- RELEASE-NOTES | 3 +++ docs/hooks.txt | 5 +++++ maintenance/parserTests.inc | 13 +++++-------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 4eab40f257..d822e8c6bf 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -179,6 +179,9 @@ lighter making things easier to read. opened during the current request. May help with some caching corner cases. * (bug 8897) Fix whitespace removal for interlanguage links with link prefix +* Add 'ParserTestTables' hook to expand the list of temporary tables copied + by the parser test harness; use for extensions which require the presence + of other tables while they work. == Languages updated == diff --git a/docs/hooks.txt b/docs/hooks.txt index c63b8a26da..86f016b1fe 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -427,6 +427,11 @@ $text: the text that will be displayed, in HTML (string) this hook and append its values to the key. $hash: reference to a hash key string which can be modified +'ParserTestTables': alter the list of tables to duplicate when parser tests +are run. Use when page save hooks require the presence of custom tables +to ensure that tests continue to run properly. +&$tables: array of table names + 'PersonalUrls': Alter the user-specific navigation links (e.g. "my page, my talk page, my contributions" etc). diff --git a/maintenance/parserTests.inc b/maintenance/parserTests.inc index 197ad3276c..331756358f 100644 --- a/maintenance/parserTests.inc +++ b/maintenance/parserTests.inc @@ -423,14 +423,11 @@ class ParserTest { 'objectcache', 'job', 'redirect', 'querycachetwo' ); - - // FIXME manually adding additional table for the tasks extension - // we probably need a better software wide system to register new - // tables. - global $wgExtensionFunctions; - if( in_array('wfTasksExtension' , $wgExtensionFunctions ) ) { - $tables[] = 'tasks'; - } + + // Allow extensions to add to the list of tables to duplicate; + // may be necessary if they hook into page save or other code + // which will require them while running tests. + wfRunHooks( 'ParserTestTables', array( &$tables ) ); return $tables; } -- 2.20.1