NOTE THAT THIS COMMIT REVEALS FAILING PARSER TESTS WHEN THEY ARE RUN IN PHPUnit....
[lhc/web/wiklou.git] / maintenance / tests / phpunit / includes / ExtraParserTest.php
1 <?php
2 /**
3 * Parser-related tests that don't suit for parserTests.txt
4 */
5
6 class ExtraParserTest extends PHPUnit_Framework_TestCase {
7
8 function setUp() {
9 global $wgMemc;
10 global $wgContLang;
11 global $wgShowDBErrorBacktrace;
12
13 $wgShowDBErrorBacktrace = true;
14 if ( $wgContLang === null ) $wgContLang = new Language;
15 $wgMemc = new FakeMemCachedClient;
16 }
17
18 function tearDown() {
19 global $wgMemc;
20
21 $wgMemc = null;
22 }
23
24 // Bug 8689 - Long numeric lines kill the parser
25 function testBug8689() {
26 global $wgLang;
27 global $wgUser;
28 $longLine = '1.' . str_repeat( '1234567890', 100000 ) . "\n";
29
30 if ( $wgLang === null ) $wgLang = new Language;
31 $parser = new Parser();
32 $t = Title::newFromText( 'Unit test' );
33 $options = ParserOptions::newFromUser( $wgUser );
34 $this->assertEquals( "<p>$longLine</p>",
35 $parser->parse( $longLine, $t, $options )->getText() );
36 }
37 }