Fixed dependencies for jquery.collapsibleTabs
[lhc/web/wiklou.git] / tests / phpunit / includes / parser / ParserMethodsTest.php
1 <?php
2
3 class ParserMethodsTest extends MediaWikiLangTestCase {
4
5 public function dataPreSaveTransform() {
6 return array(
7 array( 'hello this is ~~~',
8 "hello this is [[Special:Contributions/127.0.0.1|127.0.0.1]]",
9 ),
10 array( 'hello \'\'this\'\' is <nowiki>~~~</nowiki>',
11 'hello \'\'this\'\' is <nowiki>~~~</nowiki>',
12 ),
13 );
14 }
15
16 /**
17 * @dataProvider dataPreSaveTransform
18 */
19 public function testPreSaveTransform( $text, $expected ) {
20 global $wgParser;
21
22 $title = Title::newFromText( str_replace( '::', '__', __METHOD__ ) );
23 $user = new User();
24 $user->setName( "127.0.0.1" );
25 $popts = ParserOptions::newFromUser( $user );
26 $text = $wgParser->preSaveTransform( $text, $title, $user, $popts );
27
28 $this->assertEquals( $expected, $text );
29 }
30
31 // TODO: Add tests for cleanSig() / cleanSigInSig(), getSection(), replaceSection(), getPreloadText()
32 }
33