Remove superfluous re- from confirmemail_body_set
[mediawiki.git] / tests / phpunit / includes / parser / ParserPreloadTest.php
blobc6091640a2f569280299b6eeba18376df492c37d
1 <?php
2 /**
3 * Basic tests for Parser::getPreloadText
4 * @author Antoine Musso
5 */
6 class ParserPreloadTest extends MediaWikiTestCase {
7 private $testParser;
8 private $testParserOptions;
9 private $title;
11 protected function setUp() {
12 global $wgContLang;
14 parent::setUp();
15 $this->testParserOptions = ParserOptions::newFromUserAndLang( new User, $wgContLang );
17 $this->testParser = new Parser();
18 $this->testParser->Options( $this->testParserOptions );
19 $this->testParser->clearState();
21 $this->title = Title::newFromText( 'Preload Test' );
24 protected function tearDown() {
25 parent::tearDown();
27 unset( $this->testParser );
28 unset( $this->title );
31 /**
32 * @covers Parser::getPreloadText
34 function testPreloadSimpleText() {
35 $this->assertPreloaded( 'simple', 'simple' );
38 /**
39 * @covers Parser::getPreloadText
41 function testPreloadedPreIsUnstripped() {
42 $this->assertPreloaded(
43 '<pre>monospaced</pre>',
44 '<pre>monospaced</pre>',
45 '<pre> in preloaded text must be unstripped (bug 27467)'
49 /**
50 * @covers Parser::getPreloadText
52 function testPreloadedNowikiIsUnstripped() {
53 $this->assertPreloaded(
54 '<nowiki>[[Dummy title]]</nowiki>',
55 '<nowiki>[[Dummy title]]</nowiki>',
56 '<nowiki> in preloaded text must be unstripped (bug 27467)'
60 function assertPreloaded( $expected, $text, $msg = '' ) {
61 $this->assertEquals(
62 $expected,
63 $this->testParser->getPreloadText(
64 $text,
65 $this->title,
66 $this->testParserOptions
68 $msg