From 2e44b49a2db3026050b136de9b00f749dd3ff939 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 25 Apr 2014 06:26:49 +0200 Subject: Update to MediaWiki 1.22.6 --- .../phpunit/includes/parser/ParserMethodsTest.php | 95 ---------------------- 1 file changed, 95 deletions(-) delete mode 100644 tests/phpunit/includes/parser/ParserMethodsTest.php (limited to 'tests/phpunit/includes/parser/ParserMethodsTest.php') diff --git a/tests/phpunit/includes/parser/ParserMethodsTest.php b/tests/phpunit/includes/parser/ParserMethodsTest.php deleted file mode 100644 index e5c5cb21..00000000 --- a/tests/phpunit/includes/parser/ParserMethodsTest.php +++ /dev/null @@ -1,95 +0,0 @@ -~~~', - 'hello \'\'this\'\' is ~~~', - ), - ); - } - - /** - * @dataProvider providePreSaveTransform - * @covers Parser::preSaveTransform - */ - 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 ); - } - - /** - * @covers Parser::callParserFunction - */ - public function testCallParserFunction() { - global $wgParser; - - // Normal parses test passing PPNodes. Test passing an array. - $title = Title::newFromText( str_replace( '::', '__', __METHOD__ ) ); - $wgParser->startExternalParse( $title, new ParserOptions(), Parser::OT_HTML ); - $frame = $wgParser->getPreprocessor()->newFrame(); - $ret = $wgParser->callParserFunction( $frame, '#tag', - array( 'pre', 'foo', 'style' => 'margin-left: 1.6em' ) - ); - $ret['text'] = $wgParser->mStripState->unstripBoth( $ret['text'] ); - $this->assertSame( array( - 'found' => true, - 'text' => '
foo
', - ), $ret, 'callParserFunction works for {{#tag:pre|foo|style=margin-left: 1.6em}}' ); - } - - /** - * @covers Parser::parse - * @covers ParserOutput::getSections - */ - public function testGetSections() { - global $wgParser; - - $title = Title::newFromText( str_replace( '::', '__', __METHOD__ ) ); - $out = $wgParser->parse( "==foo==\n

bar

\n==baz==\n", $title, new ParserOptions() ); - $this->assertSame( array( - array( - 'toclevel' => 1, - 'level' => '2', - 'line' => 'foo', - 'number' => '1', - 'index' => '1', - 'fromtitle' => $title->getPrefixedDBkey(), - 'byteoffset' => 0, - 'anchor' => 'foo', - ), - array( - 'toclevel' => 1, - 'level' => '2', - 'line' => 'bar', - 'number' => '2', - 'index' => '', - 'fromtitle' => false, - 'byteoffset' => null, - 'anchor' => 'bar', - ), - array( - 'toclevel' => 1, - 'level' => '2', - 'line' => 'baz', - 'number' => '3', - 'index' => '2', - 'fromtitle' => $title->getPrefixedDBkey(), - 'byteoffset' => 21, - 'anchor' => 'baz', - ), - ), $out->getSections(), 'getSections() with proper value when

is used' ); - } - //@Todo Add tests for cleanSig() / cleanSigInSig(), getSection(), replaceSection(), getPreloadText() -} -- cgit v1.2.3-54-g00ecf