jenkins-bot has submitted this change and it was merged. Change subject: Rename PropertyParserFunction class to PropertyParserFunctionRunner ......................................................................
Rename PropertyParserFunction class to PropertyParserFunctionRunner Change-Id: I5e8403cef63afad2ee84acaa6c43926f981f7c37 --- M client/includes/hooks/ParserFunctionRegistrant.php R client/includes/parserhooks/PropertyParserFunctionRunner.php R client/tests/phpunit/includes/parserhooks/PropertyParserFunctionRunnerTest.php 3 files changed, 14 insertions(+), 14 deletions(-) Approvals: Hoo man: Looks good to me, approved WikidataJenkins: Verified jenkins-bot: Verified diff --git a/client/includes/hooks/ParserFunctionRegistrant.php b/client/includes/hooks/ParserFunctionRegistrant.php index ea1c67d..ea9545b 100644 --- a/client/includes/hooks/ParserFunctionRegistrant.php +++ b/client/includes/hooks/ParserFunctionRegistrant.php @@ -3,7 +3,7 @@ namespace Wikibase\Client\Hooks; use Parser; -use Wikibase\PropertyParserFunction; +use Wikibase\PropertyParserFunctionRunner; class ParserFunctionRegistrant { @@ -43,7 +43,7 @@ $parser->setFunctionHook( 'property', function( Parser $parser, $propertyLabel ) { - return PropertyParserFunction::render( $parser, $propertyLabel ); + return PropertyParserFunctionRunner::render( $parser, $propertyLabel ); } ); diff --git a/client/includes/parserhooks/PropertyParserFunction.php b/client/includes/parserhooks/PropertyParserFunctionRunner.php similarity index 99% rename from client/includes/parserhooks/PropertyParserFunction.php rename to client/includes/parserhooks/PropertyParserFunctionRunner.php index 93fa2ba..e624fbb 100644 --- a/client/includes/parserhooks/PropertyParserFunction.php +++ b/client/includes/parserhooks/PropertyParserFunctionRunner.php @@ -24,7 +24,7 @@ * @author Daniel Kinzler * @author Liangent < liang...@gmail.com > */ -class PropertyParserFunction { +class PropertyParserFunctionRunner { /** * @var EntityLookup diff --git a/client/tests/phpunit/includes/parserhooks/PropertyParserFunctionTest.php b/client/tests/phpunit/includes/parserhooks/PropertyParserFunctionRunnerTest.php similarity index 83% rename from client/tests/phpunit/includes/parserhooks/PropertyParserFunctionTest.php rename to client/tests/phpunit/includes/parserhooks/PropertyParserFunctionRunnerTest.php index f0ee7a7..5b3658c 100644 --- a/client/tests/phpunit/includes/parserhooks/PropertyParserFunctionTest.php +++ b/client/tests/phpunit/includes/parserhooks/PropertyParserFunctionRunnerTest.php @@ -9,10 +9,10 @@ use Wikibase\DataModel\Entity\EntityId; use Wikibase\DataModel\Entity\Item; use Wikibase\DataModel\Entity\ItemId; -use Wikibase\PropertyParserFunction; +use Wikibase\PropertyParserFunctionRunner; /** - * @covers Wikibase\PropertyParserFunction + * @covers Wikibase\PropertyParserFunctionRunner * * @group Wikibase * @group WikibaseClient @@ -22,15 +22,15 @@ * @author Jeroen De Dauw < jeroended...@gmail.com > * @author Marius Hoch < h...@online.de > */ -class PropertyParserFunctionTest extends \PHPUnit_Framework_TestCase { +class PropertyParserFunctionRunnerTest extends \PHPUnit_Framework_TestCase { /** * @param Parser $parser * @param Entity|null $entity * - * @return PropertyParserFunction + * @return PropertyParserFunctionRunner */ - private function getPropertyParserFunction( Parser $parser, Entity $entity = null ) { + private function getPropertyParserFunctionRunner( Parser $parser, Entity $entity = null ) { $entityLookup = new MockRepository(); if ( $entity !== null ) { @@ -42,7 +42,7 @@ $entityLookup ); - return new PropertyParserFunction( $entityLookup, $propertyLabelResolver ); + return new PropertyParserFunctionRunner( $entityLookup, $propertyLabelResolver ); } /** @@ -52,7 +52,7 @@ $parser = new Parser(); $parserOptions = new ParserOptions(); $parser->startExternalParse( null, $parserOptions, $outputType ); - $functionRunner = $this->getPropertyParserFunction( $parser ); + $functionRunner = $this->getPropertyParserFunctionRunner( $parser ); $renderer = $functionRunner->getRenderer( Language::factory( $languageCode ) ); $this->assertInstanceOf( 'Wikibase\PropertyParserFunctionRenderer', $renderer ); } @@ -82,7 +82,7 @@ $parser = new Parser(); $parser->startExternalParse( null, $parserOptions, $outputType ); - $instance = $this->getPropertyParserFunction( $parser ); + $instance = $this->getPropertyParserFunctionRunner( $parser ); $this->assertEquals( $expected, $instance->isParserUsingVariants( $parser ) ); } @@ -106,7 +106,7 @@ $parser = new Parser(); $parserOptions = new ParserOptions(); $parser->startExternalParse( null, $parserOptions, $outputType ); - $functionRunner = $this->getPropertyParserFunction( $parser ); + $functionRunner = $this->getPropertyParserFunctionRunner( $parser ); $this->assertEquals( $expected, $functionRunner->processRenderedArray( $textArray ) ); } @@ -130,13 +130,13 @@ $item = Item::newEmpty(); $item->setId( new ItemId( 'Q42' ) ); - $functionRunner = $this->getPropertyParserFunction( $parser, $item ); + $functionRunner = $this->getPropertyParserFunctionRunner( $parser, $item ); $lang = Language::factory( 'qqx' ); $result = $functionRunner->renderInLanguage( $item->getId(), 'invalidLabel', $lang ); // Test against the regexp of the {{#iferror parser function, as that should be able - // to detect errors from PropertyParserFunction. See ExtParserFunctions::iferror + // to detect errors from PropertyParserFunctionRunner. See ExtParserFunctions::iferror $this->assertRegExp( '/<(?:strong|span|p|div)\s(?:[^\s>]*\s+)*?class="(?:[^"\s>]*\s+)*?error(?:\s[^">]*)?"/', $result -- To view, visit https://gerrit.wikimedia.org/r/147125 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5e8403cef63afad2ee84acaa6c43926f981f7c37 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude <aude.w...@gmail.com> Gerrit-Reviewer: Hoo man <h...@online.de> Gerrit-Reviewer: WikidataJenkins <wikidata-servi...@wikimedia.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits