Declare visibility on Autoloader::$autoloadLocalClassesLower
[lhc/web/wiklou.git] / tests / phpunit / MediaWikiTestCase.php
index 440f866..6ce78b5 100644 (file)
@@ -173,7 +173,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                $this->called['setUp'] = 1;
 
                /*
-               //@todo: global variables to restore for *every* test
+               // @todo global variables to restore for *every* test
                array(
                        'wgLang',
                        'wgContLang',
@@ -537,6 +537,12 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                global $wgDBprefix;
 
                $tables = $db->listTables( $wgDBprefix, __METHOD__ );
+
+               if ( $db->getType() === 'mysql' ) {
+                       # bug 43571: cannot clone VIEWs under MySQL
+                       $views = $db->listViews( $wgDBprefix, __METHOD__ );
+                       $tables = array_diff( $tables, $views );
+               }
                $tables = array_map( array( __CLASS__, 'unprefixTable' ), $tables );
 
                // Don't duplicate test tables from the previous fataled run
@@ -777,7 +783,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
        }
 
        /**
-        * Returns true iff the given namespace defaults to Wikitext
+        * Returns true if the given namespace defaults to Wikitext
         * according to $wgNamespaceContentModels
         *
         * @param int $ns The namespace ID to check
@@ -847,7 +853,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                }
 
                // give up
-               // @todo: Inside a test, we could skip the test as incomplete.
+               // @todo Inside a test, we could skip the test as incomplete.
                //        But frequently, this is used in fixture setup.
                throw new MWException( "No namespace defaults to wikitext!" );
        }
@@ -918,6 +924,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
         * the provided code.
         *
         * @since 1.21
+        * @deprecated since 1.22 Use setExpectedException
         *
         * @param callable $code
         * @param string $expected