From: Platonides Date: Sat, 23 Jun 2012 18:28:51 +0000 (+0200) Subject: WikiPage::preSaveTransform() was deprecated in r103228 (018d885f) X-Git-Tag: 1.31.0-rc.0~23249 X-Git-Url: http://git.cyclocoop.org/%27%20.%20%24prefix%20.%20Wiki::transformTitleToURI%28%24matches%5B1%5D%29%20.%20%27?a=commitdiff_plain;h=a05c1a1ab7e963334ba609147f83555ce61eaa1e;p=lhc%2Fweb%2Fwiklou.git WikiPage::preSaveTransform() was deprecated in r103228 (018d885f) Hide the warning on the tests and add tests for the Parser method. Change-Id: I939bf59206da1dd45e33db2251e92d9792a0a767 --- diff --git a/tests/phpunit/includes/WikiPageTest.php b/tests/phpunit/includes/WikiPageTest.php index c8606cc745..b72a5cd825 100644 --- a/tests/phpunit/includes/WikiPageTest.php +++ b/tests/phpunit/includes/WikiPageTest.php @@ -769,6 +769,7 @@ more stuff * @dataProvider dataPreSaveTransform */ public function testPreSaveTransform( $text, $expected ) { + $this->hideDeprecated( 'WikiPage::preSaveTransform' ); $user = new User(); $user->setName("127.0.0.1"); diff --git a/tests/phpunit/includes/parser/ParserMethodsTest.php b/tests/phpunit/includes/parser/ParserMethodsTest.php new file mode 100644 index 0000000000..10b57ebb01 --- /dev/null +++ b/tests/phpunit/includes/parser/ParserMethodsTest.php @@ -0,0 +1,33 @@ +~~~', + 'hello \'\'this\'\' is ~~~', + ), + ); + } + + /** + * @dataProvider dataPreSaveTransform + */ + public function testPreSaveTransform( $text, $expected ) { + global $wgParser; + + $title = Title::newFromText( str_replace( '::', '__', __METHOD__ ) ); + $user = new User(); + $user->setName( "127.0.0.1" ); + $popts = ParserOptions::newFromUser( $user ); + $text = $wgParser->preSaveTransform( $text, $title, $user, $popts ); + + $this->assertEquals( $expected, $text ); + } + + // TODO: Add tests for cleanSig() / cleanSigInSig(), getSection(), replaceSection(), getPreloadText() +} +