r94826 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94825‎ | r94826 | r94827 >
Date:22:09, 17 August 2011
Author:bawolff
Status:ok
Tags:
Comment:
Make the testCleanSig work no matter what $wgCleanSignatures; is in LocalSettings.php . Also have a test for when sig cleaning is disabled.
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/ExtraParserTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/ExtraParserTest.php
@@ -63,11 +63,33 @@
6464 * cleanSig() makes all templates substs and removes tildes
6565 */
6666 function testCleanSig() {
 67+ global $wgCleanSignatures;
 68+ $oldCleanSignature = $wgCleanSignatures;
 69+ $wgCleanSignatures = true;
 70+
6771 $title = Title::newFromText( __FUNCTION__ );
6872 $outputText = $this->parser->cleanSig( "{{Foo}} ~~~~" );
 73+
 74+ $wgCleanSignatures = $oldCleanSignature;
6975
7076 $this->assertEquals( "{{SUBST:Foo}} ", $outputText );
7177 }
 78+
 79+ /**
 80+ * cleanSig() should do nothing if disabled
 81+ */
 82+ function testCleanSigDisabled() {
 83+ global $wgCleanSignatures;
 84+ $oldCleanSignature = $wgCleanSignatures;
 85+ $wgCleanSignatures = false;
 86+
 87+ $title = Title::newFromText( __FUNCTION__ );
 88+ $outputText = $this->parser->cleanSig( "{{Foo}} ~~~~" );
 89+
 90+ $wgCleanSignatures = $oldCleanSignature;
 91+
 92+ $this->assertEquals( "{{Foo}} ~~~~", $outputText );
 93+ }
7294
7395 /**
7496 * cleanSigInSig() just removes tildes

Status & tagging log