* Add 'ParserTestTables' hook to expand the list of temporary tables copied
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 9 Feb 2007 05:37:44 +0000 (05:37 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 9 Feb 2007 05:37:44 +0000 (05:37 +0000)
  by the parser test harness; use for extensions which require the presence
  of other tables while they work.

RELEASE-NOTES
docs/hooks.txt
maintenance/parserTests.inc

index 4eab40f..d822e8c 100644 (file)
@@ -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 ==
index c63b8a2..86f016b 100644 (file)
@@ -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).
 
index 197ad32..3317563 100644 (file)
@@ -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;
        }