testParserOptions = ParserOptions::newFromUserAndLang( new User, $wgContLang ); $this->testParser = new Parser(); $this->testParser->Options( $this->testParserOptions ); $this->testParser->clearState(); $this->title = Title::newFromText( 'Preload Test' ); } protected function tearDown() { parent::tearDown(); unset( $this->testParser ); unset( $this->title ); } public function testPreloadSimpleText() { $this->assertPreloaded( 'simple', 'simple' ); } public function testPreloadedPreIsUnstripped() { $this->assertPreloaded( '
monospaced
', '
monospaced
', '
 in preloaded text must be unstripped (T29467)'
		);
	}

	public function testPreloadedNowikiIsUnstripped() {
		$this->assertPreloaded(
			'[[Dummy title]]',
			'[[Dummy title]]',
			' in preloaded text must be unstripped (T29467)'
		);
	}

	protected function assertPreloaded( $expected, $text, $msg = '' ) {
		$this->assertEquals(
			$expected,
			$this->testParser->getPreloadText(
				$text,
				$this->title,
				$this->testParserOptions
			),
			$msg
		);
	}
}