Hoo man has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/349934 )
Change subject: Add a test for noexternallanglinks to MagicWordHookHandlersTest ...................................................................... Add a test for noexternallanglinks to MagicWordHookHandlersTest Related to https://wikitech.wikimedia.org/wiki/Incident_documentation/20170323-wikibase Change-Id: I5b082d3793eb1db8d56b26ae7062c854c0314bf3 --- M client/tests/phpunit/includes/Hooks/MagicWordHookHandlersTest.php 1 file changed, 31 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/34/349934/1 diff --git a/client/tests/phpunit/includes/Hooks/MagicWordHookHandlersTest.php b/client/tests/phpunit/includes/Hooks/MagicWordHookHandlersTest.php index 8049ece..4ac9553 100644 --- a/client/tests/phpunit/includes/Hooks/MagicWordHookHandlersTest.php +++ b/client/tests/phpunit/includes/Hooks/MagicWordHookHandlersTest.php @@ -6,6 +6,8 @@ use Wikibase\Client\Hooks\MagicWordHookHandlers; use MediaWikiTestCase; use Parser; +use ParserOutput; +use Title; use Wikibase\SettingsArray; use Wikimedia\TestingAccessWrapper; @@ -67,9 +69,7 @@ ]; } - // TODO: Test noexternallanglinks - - public function testDoParserGetVariableValueSwitch() { + public function testDoParserGetVariableValueSwitch_wbreponame() { $parser = $this->getMockBuilder( Parser::class ) ->getMock(); @@ -99,4 +99,32 @@ ); } + public function testDoParserGetVariableValueSwitch_noexternallanglinks() { + $parser = $this->getMockBuilder( Parser::class ) + ->getMock(); + + $out = new ParserOutput(); + $parser->method( 'getOutput' ) + ->willReturn( $out ); + $parser->method( 'getTitle' ) + ->willReturn( Title::newMainPage() ); + + $handler = TestingAccessWrapper::newFromObject( + new MagicWordHookHandlers( new SettingsArray() ) + ); + + $ret = null; + $cache = []; + $word = 'noexternallanglinks'; + call_user_func_array( + [ $handler, 'doParserGetVariableValueSwitch' ], + [ &$parser, &$cache, &$word, &$ret ] + ); + + $this->assertType( + 'string', + $out->getProperty( 'noexternallanglinks' ) + ); + } + } -- To view, visit https://gerrit.wikimedia.org/r/349934 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5b082d3793eb1db8d56b26ae7062c854c0314bf3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Hoo man <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
