Index: trunk/phase3/tests/phpunit/includes/ExtraParserTest.php |
— | — | @@ -63,11 +63,33 @@ |
64 | 64 | * cleanSig() makes all templates substs and removes tildes |
65 | 65 | */ |
66 | 66 | function testCleanSig() { |
| 67 | + global $wgCleanSignatures; |
| 68 | + $oldCleanSignature = $wgCleanSignatures; |
| 69 | + $wgCleanSignatures = true; |
| 70 | + |
67 | 71 | $title = Title::newFromText( __FUNCTION__ ); |
68 | 72 | $outputText = $this->parser->cleanSig( "{{Foo}} ~~~~" ); |
| 73 | + |
| 74 | + $wgCleanSignatures = $oldCleanSignature; |
69 | 75 | |
70 | 76 | $this->assertEquals( "{{SUBST:Foo}} ", $outputText ); |
71 | 77 | } |
| 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 | + } |
72 | 94 | |
73 | 95 | /** |
74 | 96 | * cleanSigInSig() just removes tildes |