Merge "Caching documentation tweaks and doxygen cleanups"
[lhc/web/wiklou.git] / tests / phpunit / MediaWikiTestCase.php
index ac214a2..9bbbf9f 100644 (file)
@@ -103,6 +103,12 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                 */
                ObjectCache::$instances[CACHE_DB] = new HashBagOStuff;
 
+               // Sandbox APC by replacing with in-process hash instead.
+               // Ensures values are removed between tests.
+               ObjectCache::$instances['apc'] =
+               ObjectCache::$instances['xcache'] =
+               ObjectCache::$instances['wincache'] = new HashBagOStuff;
+
                $needsResetDB = false;
 
                if ( $this->needsDB() ) {
@@ -217,7 +223,9 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
 
        protected function tearDown() {
                $status = ob_get_status();
-               if ( isset( $status['name'] ) && $status['name'] === 'MediaWikiTestCase::wfResetOutputBuffersBarrier' ) {
+               if ( isset( $status['name'] ) &&
+                       $status['name'] === 'MediaWikiTestCase::wfResetOutputBuffersBarrier'
+               ) {
                        ob_end_flush();
                }
 
@@ -1117,7 +1125,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                // of tidy. In that case however, we can not reliably detect whether a failing validation
                // is due to malformed HTML, or caused by tidy not being installed as a command line tool.
                // That would cause all HTML assertions to fail on a system that has no tidy installed.
-               if ( !$GLOBALS['wgTidyInternal'] ) {
+               if ( !$GLOBALS['wgTidyInternal'] || !MWTidy::isEnabled() ) {
                        $this->markTestSkipped( 'Tidy extension not installed' );
                }
 
@@ -1151,7 +1159,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
 
        /**
         * Note: we are overriding this method to remove the deprecated error
-        * @see https://bugzilla.wikimedia.org/show_bug.cgi?id=69505
+        * @see https://phabricator.wikimedia.org/T71505
         * @see https://github.com/sebastianbergmann/phpunit/issues/1292
         * @deprecated
         *
@@ -1161,7 +1169,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
         * @param bool $isHtml
         */
        public static function assertTag( $matcher, $actual, $message = '', $isHtml = true ) {
-               //trigger_error(__METHOD__ . ' is deprecated', E_USER_DEPRECATED);
+               // trigger_error(__METHOD__ . ' is deprecated', E_USER_DEPRECATED);
 
                self::assertTrue( self::tagMatch( $matcher, $actual, $isHtml ), $message );
        }
@@ -1176,7 +1184,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
         * @param bool $isHtml
         */
        public static function assertNotTag( $matcher, $actual, $message = '', $isHtml = true ) {
-               //trigger_error(__METHOD__ . ' is deprecated', E_USER_DEPRECATED);
+               // trigger_error(__METHOD__ . ' is deprecated', E_USER_DEPRECATED);
 
                self::assertFalse( self::tagMatch( $matcher, $actual, $isHtml ), $message );
        }