http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89302

Revision: 89302
Author:   demon
Date:     2011-06-01 22:54:33 +0000 (Wed, 01 Jun 2011)
Log Message:
-----------
Exclude Block tests until somebody fixes them, also cache listTables() result 
so we can skip some queries

Modified Paths:
--------------
    trunk/phase3/tests/phpunit/MediaWikiTestCase.php
    trunk/phase3/tests/phpunit/includes/BlockTest.php

Modified: trunk/phase3/tests/phpunit/MediaWikiTestCase.php
===================================================================
--- trunk/phase3/tests/phpunit/MediaWikiTestCase.php    2011-06-01 22:43:19 UTC 
(rev 89301)
+++ trunk/phase3/tests/phpunit/MediaWikiTestCase.php    2011-06-01 22:54:33 UTC 
(rev 89302)
@@ -12,6 +12,7 @@
        protected $oldTablePrefix;
        protected $useTemporaryTables = true;
        private static $dbSetup = false;
+       private static $dbTables = null;
 
        /**
         * Table name prefixes. Oracle likes it shorter.
@@ -191,18 +192,21 @@
        protected function listTables() {
                global $wgDBprefix;
 
-               $tables = $this->db->listTables( $wgDBprefix, __METHOD__ );
-               $tables = array_map( array( __CLASS__, 'unprefixTable' ), 
$tables );
+               if( is_null( self::$dbTables ) ) {
+                       $tables = $this->db->listTables( $wgDBprefix, 
__METHOD__ );
+                       $tables = array_map( array( __CLASS__, 'unprefixTable' 
), $tables );
 
-               if ( $this->db->getType() == 'sqlite' ) {
-                       $tables = array_flip( $tables );
-                       // these are subtables of searchindex and don't need to 
be duped/dropped separately
-                       unset( $tables['searchindex_content'] );
-                       unset( $tables['searchindex_segdir'] );
-                       unset( $tables['searchindex_segments'] );
-                       $tables = array_flip( $tables );
+                       if ( $this->db->getType() == 'sqlite' ) {
+                               $tables = array_flip( $tables );
+                               // these are subtables of searchindex and don't 
need to be duped/dropped separately
+                               unset( $tables['searchindex_content'] );
+                               unset( $tables['searchindex_segdir'] );
+                               unset( $tables['searchindex_segments'] );
+                               $tables = array_flip( $tables );
+                       }
+                       self::$dbTables = $tables;
                }
-               return $tables;
+               return self::$dbTables;
                
        }
        

Modified: trunk/phase3/tests/phpunit/includes/BlockTest.php
===================================================================
--- trunk/phase3/tests/phpunit/includes/BlockTest.php   2011-06-01 22:43:19 UTC 
(rev 89301)
+++ trunk/phase3/tests/phpunit/includes/BlockTest.php   2011-06-01 22:54:33 UTC 
(rev 89302)
@@ -2,6 +2,7 @@
 
 /**
  * @group Database
+ * @group Broken
  */
 class BlockTest extends MediaWikiLangTestCase {
        


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

Reply via email to