Per wikitech-l discussion: Move tests from maintenance/tests/ to tests/. They're...
[lhc/web/wiklou.git] / 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 // Bug 8689 - Long numeric lines kill the parser
19 function testBug8689() {
20 global $wgLang;
21 global $wgUser;
22 $longLine = '1.' . str_repeat( '1234567890', 100000 ) . "\n";
23
24 if ( $wgLang === null ) $wgLang = new Language;
25 $parser = new Parser();
26 $t = Title::newFromText( 'Unit test' );
27 $options = ParserOptions::newFromUser( $wgUser );
28 $this->assertEquals( "<p>$longLine</p>",
29 $parser->parse( $longLine, $t, $options )->getText() );
30 }
31 }