Jeroen De Dauw has uploaded a new change for review.
https://gerrit.wikimedia.org/r/74642
Change subject: Add getEntityIdFormatter to top level factory
......................................................................
Add getEntityIdFormatter to top level factory
Change-Id: I6a0caf0cdbaee73dfca2e03ded63dc01e1cbaa2e
---
M repo/includes/WikibaseRepo.php
M repo/tests/phpunit/includes/WikibaseRepoTest.php
2 files changed, 18 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/42/74642/1
diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php
index a68149f..e4ab4ad 100644
--- a/repo/includes/WikibaseRepo.php
+++ b/repo/includes/WikibaseRepo.php
@@ -247,6 +247,19 @@
/**
* @since 0.4
*
+ * @return EntityIdFormatter
+ */
+ public function getEntityIdFormatter() {
+ $options = new ParserOptions( array(
+ EntityIdParser::OPT_PREFIX_MAP =>
$this->settings->getSetting( 'entityPrefixes' )
+ ) );
+
+ return new EntityIdFormatter( $options );
+ }
+
+ /**
+ * @since 0.4
+ *
* @return LanguageFallbackChainFactory
*/
public function getLanguageFallbackChainFactory() {
diff --git a/repo/tests/phpunit/includes/WikibaseRepoTest.php
b/repo/tests/phpunit/includes/WikibaseRepoTest.php
index 04ed56e..e081b3a 100644
--- a/repo/tests/phpunit/includes/WikibaseRepoTest.php
+++ b/repo/tests/phpunit/includes/WikibaseRepoTest.php
@@ -60,6 +60,11 @@
$this->assertInstanceOf( 'Wikibase\Lib\EntityIdParser',
$returnValue );
}
+ public function testGetEntityIdFormatterReturnType() {
+ $returnValue =
$this->getDefaultInstance()->getEntityIdFormatter();
+ $this->assertInstanceOf( 'Wikibase\Lib\EntityIdFormatter',
$returnValue );
+ }
+
public static function provideGetRdfBaseURI() {
return array(
array ( 'http://acme.test', 'http://acme.test/entity/'
),
--
To view, visit https://gerrit.wikimedia.org/r/74642
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a0caf0cdbaee73dfca2e03ded63dc01e1cbaa2e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits