From: Mark A. Hershberger Date: Mon, 1 Feb 2010 04:57:42 +0000 (+0000) Subject: follow up 61775 -- REVERT REVERT X-Git-Tag: 1.31.0-rc.0~37999 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=faac46493e1ccc6e1d0b0829e6dde0996af0db9a;p=lhc%2Fweb%2Fwiklou.git follow up 61775 -- REVERT REVERT --- diff --git a/includes/MessageCache.php b/includes/MessageCache.php index 62f08134d2..e5eb7057eb 100644 --- a/includes/MessageCache.php +++ b/includes/MessageCache.php @@ -399,18 +399,16 @@ class MessageCache { // Also delete cached sidebar... just in case it is affected global $parserMemc; - if(is_object($parserMemc)) { - $codes = array( $code ); - if ( $code === 'en' ) { - // Delete all sidebars, like for example on action=purge on the - // sidebar messages - $codes = array_keys( Language::getLanguageNames() ); - } + $codes = array( $code ); + if ( $code === 'en' ) { + // Delete all sidebars, like for example on action=purge on the + // sidebar messages + $codes = array_keys( Language::getLanguageNames() ); + } - foreach ( $codes as $code ) { - $sidebarKey = wfMemcKey( 'sidebar', $code ); - $parserMemc->delete( $sidebarKey ); - } + foreach ( $codes as $code ) { + $sidebarKey = wfMemcKey( 'sidebar', $code ); + $parserMemc->delete( $sidebarKey ); } wfRunHooks( "MessageCacheReplace", array( $title, $text ) ); diff --git a/includes/Namespace.php b/includes/Namespace.php index 8bf784fd95..974036cf69 100644 --- a/includes/Namespace.php +++ b/includes/Namespace.php @@ -8,7 +8,6 @@ * Definitions of the NS_ constants are in Defines.php * @private */ -global $wgCanonicalNamespaceNames; $wgCanonicalNamespaceNames = array( NS_MEDIA => 'Media', NS_SPECIAL => 'Special', diff --git a/includes/Title.php b/includes/Title.php index 1a301923fc..0f2b353db2 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -3451,12 +3451,7 @@ class Title { * @return \type{\string} String representation of this title */ public function __toString() { - $bt = debug_backtrace(); - foreach($bt as $b) { - print "{$b['file']}:{$b['line']}\n"; - } - exit; - return $this->getPrefixedText(); + return $this->getPrefixedText(); } /** diff --git a/maintenance/parserTests.inc b/maintenance/parserTests.inc index 8624dc64cb..a69a5c34e3 100644 --- a/maintenance/parserTests.inc +++ b/maintenance/parserTests.inc @@ -640,7 +640,6 @@ class ParserTest { 'wgNoFollowLinks' => true, 'wgNoFollowDomainExceptions' => array(), 'wgThumbnailScriptPath' => false, - 'wgUseImageResize' => false, 'wgUseTeX' => false, 'wgLocaltimezone' => 'UTC', 'wgAllowExternalImages' => true, diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index 2f9b9e0e30..b00df4da86 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -3283,7 +3283,7 @@ Thumbnail image caption with a free URL !! input [[Image:foobar.jpg|thumb|http://example.com]] !! result -
+
!! end @@ -3292,7 +3292,7 @@ Thumbnail image caption with a free URL and explicit alt !! input [[Image:foobar.jpg|thumb|http://example.com|alt=Alteration]] !! result -
+
!! end @@ -3301,7 +3301,7 @@ BUG 1887: A ISBN with a thumbnail !! input [[Image:foobar.jpg|thumb|ISBN 1235467890]] !! result -
+
!! end @@ -3310,7 +3310,7 @@ BUG 1887: A RFC with a thumbnail !! input [[Image:foobar.jpg|thumb|This is RFC 12354]] !! result -
This is RFC 12354
+
This is RFC 12354
!! end @@ -3319,7 +3319,7 @@ BUG 1887: A mailto link with a thumbnail !! input [[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]] !! result -
+
!! end @@ -3329,7 +3329,7 @@ so math is not stripped and turns up as escaped <math> tags. !! input [[Image:foobar.jpg|thumb|2+2]] !! result -
<math>2+2</math>
+
<math>2+2</math>
!! end @@ -3340,7 +3340,7 @@ math !! input [[Image:foobar.jpg|thumb|2+2]] !! result -
2 + 2
+
2 + 2
!! end @@ -3413,7 +3413,7 @@ Image caption containing another image !! input [[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]] !! result -
This is a caption with another File:Icon.png inside it!
+
This is a caption with another File:Icon.png inside it!
!! end @@ -3433,7 +3433,7 @@ Bug 3090: External links other than http: in image captions !! input [[Image:Foobar.jpg|thumb|200px|This caption has [irc://example.net irc] and [https://example.com Secure] ext links in it.]] !! result -
This caption has irc and Secure ext links in it.
+
This caption has irc and Secure ext links in it.
!! end @@ -6381,7 +6381,7 @@ Width + Height sized image (using px) (height is ignored) !! input [[Image:foobar.jpg|640x480px]] !! result -

Foobar.jpg +

Foobar.jpg

!!end @@ -6390,7 +6390,7 @@ Width-sized image (using px, no following whitespace) !! input [[Image:foobar.jpg|640px]] !! result -

Foobar.jpg +

Foobar.jpg

!!end @@ -6399,7 +6399,7 @@ Width-sized image (using px, with following whitespace - test regression from r3 !! input [[Image:foobar.jpg|640px ]] !! result -

Foobar.jpg +

Foobar.jpg

!!end @@ -6408,7 +6408,7 @@ Width-sized image (using px, with preceding whitespace - test regression from r3 !! input [[Image:foobar.jpg| 640px]] !! result -

Foobar.jpg +

Foobar.jpg

!!end @@ -6450,7 +6450,7 @@ disabled !! input [[image:Foobar.jpg|thumb|An [http://test/?param1=|left|¶m2=|x external] URL]] !! result -
An external URL
An external URL
+
An external URL
An external URL
!!end @@ -7351,7 +7351,7 @@ Free external link invading image caption !! input [[Image:Foobar.jpg|thumb|http://x|hello]] !! result -
hello
+
hello
!! end diff --git a/tests/MediaWikiParserTest.php b/tests/MediaWikiParserTest.php index 600ed34d7e..ad2ed61e0e 100644 --- a/tests/MediaWikiParserTest.php +++ b/tests/MediaWikiParserTest.php @@ -23,6 +23,7 @@ class PTShell extends ParserTest { function showSuccess( $desc ) { $this->cb->assertTrue( true, $desc ); + echo "PASSED: $desc\n"; return true; } @@ -145,10 +146,21 @@ class MediaWikiParserTest extends PHPUnit_Framework_TestCase { $wgStyleSheetPath = '/skins'; $wgStylePath = '/skins'; $wgThumbnailScriptPath = false; + $this->uploadDir = $this->setupUploadDir(); + $wgLocalFileRepo = array( + 'class' => 'LocalRepo', + 'name' => 'local', + 'directory' => $this->uploadDir, + 'url' => 'http://example.com/images', + 'hashLevels' => 2, + 'transformVia404' => false, + ); + //$wgNamespacesWithSubpages = array( 0 => isset( $opts['subpage'] ) ); $wgNamespaceProtection[NS_MEDIAWIKI] = 'editinterface'; $wgNamespaceAliases['Image'] = NS_FILE; $wgNamespaceAliases['Image_talk'] = NS_FILE_TALK; + $wgEnableParserCache = false; $wgDeferredUpdateList = array(); $wgMemc =& wfGetMainCache(); @@ -169,8 +181,35 @@ class MediaWikiParserTest extends PHPUnit_Framework_TestCase { $this->parserTester = new PTShell(); $this->parserTester->setCallback( $this ); + /* global $wgDBtype, $wgDBserver, $wgDBname, $wgDBuser, $wgDBpassword, $wgDBport, $wgDBmwschema, $wgDBts2chema; */ + /* $this->db['type'] = $wgDBtype; */ + /* $this->db['server'] = $wgDBserver; */ + /* $this->db['name'] = $wgDBname; */ + /* $this->db['user'] = $wgDBuser; */ + /* $this->db['password'] = $wgDBpassword; */ + /* $this->db['port'] = $wgDBport; */ + /* $this->db['mwschema'] = $wgDBmwschema; */ + /* $this->db['ts2schema'] = $wgDBts2chema; */ + } + + function tearDown() { + $this->teardownUploadDir($this->uploadDir); + /* $db = wfGetDB( DB_MASTER ); */ + /* $db->close(); */ + /* global $wgDBtype, $wgDBserver, $wgDBname, $wgDBuser, $wgDBpassword, $wgDBport, $wgDBmwschema, $wgDBts2chema; */ + + /* $wgDBtype = $this->db['type']; */ + /* $wgDBserver = $this->db['server']; */ + /* $wgDBname = $this->db['name']; */ + /* $wgDBuser = $this->db['user']; */ + /* $wgDBpassword = $this->db['password']; */ + /* $wgDBport = $this->db['port']; */ + /* $wgDBmwschema = $this->db['mwschema']; */ + /* $wgDBts2chema = $this->db['ts2schema']; */ + } + function testParser() { global $IP; diff --git a/tests/MediaWiki_TestCase.php b/tests/MediaWiki_TestCase.php index 5ddb93a5fd..3e6b40acdf 100644 --- a/tests/MediaWiki_TestCase.php +++ b/tests/MediaWiki_TestCase.php @@ -7,10 +7,7 @@ abstract class MediaWiki_TestCase extends PHPUnit_Framework_TestCase { */ protected function buildTestDatabase( $tables ) { global $testOptions, $wgDBprefix, $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname; - if(!$wgDBadminuser || !$wgDBadminpassword) { - $this->markTestIncomplete("This test requires DB admin user credentials."); - } - + $this->markTestIncomplete("This test requires DB admin user credentials."); $wgDBprefix = 'parsertest_'; $db = new DatabaseMysql( @@ -19,8 +16,7 @@ abstract class MediaWiki_TestCase extends PHPUnit_Framework_TestCase { $wgDBadminpassword, $wgDBname ); if( $db->isOpen() ) { - if (!(strcmp($db->getServerVersion(), '4.1') < 0 and - stristr($db->getSoftwareLink(), 'MySQL'))) { + if (!(strcmp($db->getServerVersion(), '4.1') < 0 and stristr($db->getSoftwareLink(), 'MySQL'))) { # Database that supports CREATE TABLE ... LIKE foreach ($tables as $tbl) { $newTableName = $db->tableName( $tbl ); @@ -45,6 +41,7 @@ abstract class MediaWiki_TestCase extends PHPUnit_Framework_TestCase { } $db->query($create_tmp); } + } return $db; } else {