jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327160 )

Change subject: New Wikidata Build - 2016-12-14T10:00:01+0000
......................................................................


New Wikidata Build - 2016-12-14T10:00:01+0000

Change-Id: Ic6bbc2aa0521231769c55ba659169fc727606509
---
M composer.lock
M extensions/ArticlePlaceholder/i18n/cs.json
M extensions/Wikibase/client/i18n/wuu.json
M 
extensions/Wikibase/client/includes/DataAccess/Scribunto/WikibaseLanguageDependentLuaBindings.php
M extensions/Wikibase/client/includes/WikibaseClient.php
M 
extensions/Wikibase/client/tests/phpunit/includes/DataAccess/Scribunto/WikibaseLanguageDependentLuaBindingsTest.php
M 
extensions/Wikibase/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php
M 
extensions/Wikibase/client/tests/phpunit/includes/Hooks/EditActionHookHandlerTest.php
M 
extensions/Wikibase/client/tests/phpunit/includes/Hooks/InfoActionHookHandlerTest.php
M 
extensions/Wikibase/client/tests/phpunit/includes/Hooks/LanguageLinkBadgeDisplayTest.php
R 
extensions/Wikibase/lib/includes/Store/RepositorySpecificEntityRevisionLookupFactory.php
M extensions/Wikibase/lib/tests/phpunit/Formatters/EntityIdLinkFormatterTest.php
M 
extensions/Wikibase/lib/tests/phpunit/Formatters/EntityIdPlainLinkFormatterTest.php
M 
extensions/Wikibase/lib/tests/phpunit/Formatters/EntityIdTitleFormatterTest.php
R 
extensions/Wikibase/lib/tests/phpunit/Store/RepositorySpecificEntityRevisionLookupFactoryTest.php
M extensions/Wikibase/repo/includes/Api/SetClaimValue.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpMainSnak.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpStatement.php
M extensions/Wikibase/repo/includes/ParserOutput/GeoDataDataUpdater.php
M extensions/Wikibase/repo/includes/WikibaseRepo.php
M extensions/Wikibase/repo/tests/phpunit/includes/Api/EntitySearchHelperTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Api/QuerySearchEntitiesTest.php
M extensions/Wikibase/repo/tests/phpunit/includes/Api/SearchEntitiesTest.php
M extensions/Wikibase/repo/tests/phpunit/includes/ChangeDispatcherTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Hooks/InfoActionHookHandlerTest.php
M extensions/Wikibase/repo/tests/phpunit/includes/SummaryFormatterTest.php
M extensions/Wikibase/view/src/StatementGroupListView.php
M extensions/Wikibase/view/src/ViewFactory.php
M extensions/Wikibase/view/tests/phpunit/StatementGroupListViewTest.php
M extensions/Wikibase/view/tests/phpunit/ViewFactoryTest.php
M vendor/composer/autoload_classmap.php
M vendor/composer/installed.json
32 files changed, 429 insertions(+), 256 deletions(-)

Approvals:
  Aude: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/composer.lock b/composer.lock
index 7e86903..089b7a8 100644
--- a/composer.lock
+++ b/composer.lock
@@ -797,12 +797,12 @@
             "source": {
                 "type": "git",
                 "url": 
"https://github.com/wikimedia/mediawiki-extensions-ArticlePlaceholder.git";,
-                "reference": "073655e60027306b3e49651ad2b33d9104a02f23"
+                "reference": "f46f7485ab6be0390b53cf6c6f5dcd6db8b73da2"
             },
             "dist": {
                 "type": "zip",
-                "url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-ArticlePlaceholder/zipball/073655e60027306b3e49651ad2b33d9104a02f23";,
-                "reference": "073655e60027306b3e49651ad2b33d9104a02f23",
+                "url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-ArticlePlaceholder/zipball/f46f7485ab6be0390b53cf6c6f5dcd6db8b73da2";,
+                "reference": "f46f7485ab6be0390b53cf6c6f5dcd6db8b73da2",
                 "shasum": ""
             },
             "require-dev": {
@@ -827,7 +827,7 @@
             ],
             "description": "Provides a special page with Wikibase information 
about a certain topic, with invitation to create an article for the topic",
             "homepage": 
"https://www.mediawiki.org/wiki/Extension:ArticlePlaceholder";,
-            "time": "2016-12-12 21:18:26"
+            "time": "2016-12-13 21:39:24"
         },
         {
             "name": "propertysuggester/property-suggester",
@@ -1585,12 +1585,12 @@
             "source": {
                 "type": "git",
                 "url": 
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git";,
-                "reference": "814270bb953c92360b0c4c2bdb52b96764ad0078"
+                "reference": "2bd1411ceb2bc0c2000ad1417dc0ef8bf8af78a1"
             },
             "dist": {
                 "type": "zip",
-                "url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/814270bb953c92360b0c4c2bdb52b96764ad0078";,
-                "reference": "814270bb953c92360b0c4c2bdb52b96764ad0078",
+                "url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/2bd1411ceb2bc0c2000ad1417dc0ef8bf8af78a1";,
+                "reference": "2bd1411ceb2bc0c2000ad1417dc0ef8bf8af78a1",
                 "shasum": ""
             },
             "require": {
@@ -1662,7 +1662,7 @@
                 "wikibaserepo",
                 "wikidata"
             ],
-            "time": "2016-12-12 21:44:23"
+            "time": "2016-12-13 21:47:00"
         },
         {
             "name": "wikibase/wikimedia-badges",
diff --git a/extensions/ArticlePlaceholder/i18n/cs.json 
b/extensions/ArticlePlaceholder/i18n/cs.json
index 7e1da7c..e966c0f 100644
--- a/extensions/ArticlePlaceholder/i18n/cs.json
+++ b/extensions/ArticlePlaceholder/i18n/cs.json
@@ -13,10 +13,13 @@
        "articleplaceholder-abouttopic-entityid": "Zadejte ID položky, např. 
Q12345",
        "articleplaceholder-abouttopic-submit": "sestavit",
        "articleplaceholder-abouttopic-no-entity-error": "Toto není platné ID 
položky.",
-       "articleplaceholder-abouttopic-create-article": "Vytvořit nový článek s 
názvem",
+       "articleplaceholder-abouttopic-create-article-title": "Vytvořte nový 
článek",
        "articleplaceholder-abouttopic-create-article-label": "Název článku",
        "articleplaceholder-abouttopic-create-article-mandatory": "Název článku 
je povinný.",
        "articleplaceholder-abouttopic-create-article-button": "Vytvořit 
článek",
+       "articleplaceholder-abouttopic-create-emtpy-article-button": "Začít 
nový článek",
+       "articleplaceholder-abouttopic-translate-article-label": "Zdrojový 
jazyk:",
+       "articleplaceholder-abouttopic-translate-article-button": "Přeložit 
článek",
        "articleplaceholder-abouttopic-create-article-submit-button": "Odeslat",
        "articleplaceholder-abouttopic-article-exists-error": "Článek s tímto 
jménem již existuje",
        "articleplaceholder-abouttopic-lua-entity": "Entita",
diff --git a/extensions/Wikibase/client/i18n/wuu.json 
b/extensions/Wikibase/client/i18n/wuu.json
index dc76cb5..60fb75b 100644
--- a/extensions/Wikibase/client/i18n/wuu.json
+++ b/extensions/Wikibase/client/i18n/wuu.json
@@ -15,5 +15,6 @@
        "wikibase-rc-hide-wikidata-show": "显示",
        "wikibase-rc-wikibase-edit-letter": "数",
        "wikibase-rc-wikibase-edit-title": "{{WBREPONAME}}编辑",
+       "wikibase-pageinfo-entity-usage": "箇页用着个{{WBREPONAME}}实体",
        "wikibase-otherprojects": "别个项目里向"
 }
diff --git 
a/extensions/Wikibase/client/includes/DataAccess/Scribunto/WikibaseLanguageDependentLuaBindings.php
 
b/extensions/Wikibase/client/includes/DataAccess/Scribunto/WikibaseLanguageDependentLuaBindings.php
index 48000c3..2bf38eb 100644
--- 
a/extensions/Wikibase/client/includes/DataAccess/Scribunto/WikibaseLanguageDependentLuaBindings.php
+++ 
b/extensions/Wikibase/client/includes/DataAccess/Scribunto/WikibaseLanguageDependentLuaBindings.php
@@ -7,6 +7,8 @@
 use Wikibase\DataModel\Entity\EntityIdParsingException;
 use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup;
 use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookupException;
+use Wikibase\DataModel\Term\Term;
+use Wikibase\DataModel\Term\TermFallback;
 use Wikibase\Lib\Store\StorageException;
 
 /**
@@ -82,7 +84,7 @@
                }
 
                // NOTE: This tracks a label usage in the wiki's content 
language.
-               return [ $term->getText(), $term->getLanguageCode() ];
+               return [ $term->getText(), $this->getTermLanguage( $term ) ];
        }
 
        /**
@@ -115,7 +117,20 @@
                // XXX: This. Sucks. A lot.
                // Also notes about language fallbacks from getLabel apply
                $this->usageAccumulator->addOtherUsage( $entityId );
-               return [ $term->getText(), $term->getLanguageCode() ];
+               return [ $term->getText(), $this->getTermLanguage( $term ) ];
+       }
+
+       /**
+        * @param Term $term
+        *
+        * @return string
+        */
+       private function getTermLanguage( Term $term ) {
+               if ( $term instanceof TermFallback ) {
+                       return $term->getActualLanguageCode();
+               }
+
+               return $term->getLanguageCode();
        }
 
 }
diff --git a/extensions/Wikibase/client/includes/WikibaseClient.php 
b/extensions/Wikibase/client/includes/WikibaseClient.php
index 9f0a255..41f5934 100644
--- a/extensions/Wikibase/client/includes/WikibaseClient.php
+++ b/extensions/Wikibase/client/includes/WikibaseClient.php
@@ -82,6 +82,7 @@
 use Wikibase\Lib\Store\EntityNamespaceLookup;
 use Wikibase\Lib\Store\FallbackPropertyOrderProvider;
 use Wikibase\Lib\Store\HttpUrlPropertyOrderProvider;
+use Wikibase\Lib\Store\PropertyOrderProvider;
 use Wikibase\Lib\Store\WikiPagePropertyOrderProvider;
 use Wikibase\Lib\WikibaseSnakFormatterBuilders;
 use Wikibase\Lib\WikibaseValueFormatterBuilders;
@@ -1202,7 +1203,7 @@
        }
 
        /**
-        * @return CachingPropertyOrderProvider
+        * @return PropertyOrderProvider
         */
        public function getPropertyOrderProvider() {
                if ( $this->propertyOrderProvider === null ) {
diff --git 
a/extensions/Wikibase/client/tests/phpunit/includes/DataAccess/Scribunto/WikibaseLanguageDependentLuaBindingsTest.php
 
b/extensions/Wikibase/client/tests/phpunit/includes/DataAccess/Scribunto/WikibaseLanguageDependentLuaBindingsTest.php
index e835d53..259cff5 100644
--- 
a/extensions/Wikibase/client/tests/phpunit/includes/DataAccess/Scribunto/WikibaseLanguageDependentLuaBindingsTest.php
+++ 
b/extensions/Wikibase/client/tests/phpunit/includes/DataAccess/Scribunto/WikibaseLanguageDependentLuaBindingsTest.php
@@ -12,6 +12,7 @@
 use Wikibase\DataModel\Entity\BasicEntityIdParser;
 use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup;
 use Wikibase\DataModel\Term\Term;
+use Wikibase\DataModel\Term\TermFallback;
 
 /**
  * @covers 
Wikibase\Client\DataAccess\Scribunto\WikibaseLanguageDependentLuaBindings
@@ -28,18 +29,33 @@
 class WikibaseLanguageDependentLuaBindingsTest extends 
PHPUnit_Framework_TestCase {
 
        public function testConstructor() {
-               $wikibaseLuaBindings = 
$this->getWikibaseLanguageDependentLuaBindings();
+               $wikibaseLuaBindings = 
$this->getWikibaseLanguageDependentLuaBindings(
+                       $this->getLabelDescriptionLookup()
+               );
 
                $this->assertInstanceOf( 
WikibaseLanguageDependentLuaBindings::class, $wikibaseLuaBindings );
        }
 
        /**
+        * @param LabelDescriptionLookup $labelDescriptionLookup
         * @param UsageAccumulator|null $usageAccumulator
         * @return WikibaseLuaBindings
         */
        private function getWikibaseLanguageDependentLuaBindings(
+               LabelDescriptionLookup $labelDescriptionLookup,
                UsageAccumulator $usageAccumulator = null
        ) {
+               return new WikibaseLanguageDependentLuaBindings(
+                       new BasicEntityIdParser(),
+                       $labelDescriptionLookup,
+                       $usageAccumulator ?: new HashUsageAccumulator()
+               );
+       }
+
+       /**
+        * @return LabelDescriptionLookup
+        */
+       private function getLabelDescriptionLookup() {
                $labelDescriptionLookup = $this->getMock( 
LabelDescriptionLookup::class );
                $labelDescriptionLookup->expects( $this->any() )
                        ->method( 'getLabel' )
@@ -49,11 +65,28 @@
                        ->method( 'getDescription' )
                        ->will( $this->returnValue( new Term( 'lang-code', 
'DescriptionString' ) ) );
 
-               return new WikibaseLanguageDependentLuaBindings(
-                       new BasicEntityIdParser(),
-                       $labelDescriptionLookup,
-                       $usageAccumulator ?: new HashUsageAccumulator()
-               );
+               return $labelDescriptionLookup;
+       }
+
+       /**
+        * @return LabelDescriptionLookup
+        */
+       private function getLabelDescriptionLookupWithFallback() {
+               $labelDescriptionLookup = $this->getMock( 
LabelDescriptionLookup::class );
+
+               $labelDescriptionLookup->expects( $this->any() )
+                       ->method( 'getLabel' )
+                       ->will( $this->returnValue(
+                               new TermFallback( 'ar', 'en-label-fallback', 
'en', null )
+                       ) );
+
+               $labelDescriptionLookup->expects( $this->any() )
+                       ->method( 'getDescription' )
+                       ->will( $this->returnValue(
+                               new TermFallback( 'ar', 'en-desc-fallback', 
'en', null )
+                       ) );
+
+               return $labelDescriptionLookup;
        }
 
        private function hasUsage( $actualUsages, EntityId $entityId, $aspect ) 
{
@@ -76,15 +109,29 @@
         * @param string $itemId
         */
        public function testGetLabel( $expected, $itemId ) {
-               $wikibaseLuaBindings = 
$this->getWikibaseLanguageDependentLuaBindings();
+               $wikibaseLuaBindings = 
$this->getWikibaseLanguageDependentLuaBindings(
+                       $this->getLabelDescriptionLookup()
+               );
 
                $this->assertSame( $expected, $wikibaseLuaBindings->getLabel( 
$itemId ) );
+       }
+
+       public function testGetLabelWithFallback() {
+               $wikibaseLuaBindings = 
$this->getWikibaseLanguageDependentLuaBindings(
+                       $this->getLabelDescriptionLookupWithFallback()
+               );
+
+               $this->assertSame(
+                       [ 'en-label-fallback', 'en' ],
+                       $wikibaseLuaBindings->getLabel( 'Q1234' )
+               );
        }
 
        public function testGetLabel_usage() {
                $usages = new HashUsageAccumulator();
 
                $wikibaseLuaBindings = 
$this->getWikibaseLanguageDependentLuaBindings(
+                       $this->getLabelDescriptionLookup(),
                        $usages
                );
 
@@ -92,8 +139,15 @@
                $wikibaseLuaBindings->getLabel( $itemId->getSerialization() );
 
                //NOTE: label usage is not tracked directly, this is done via 
the LabelDescriptionLookup
-               $this->assertFalse( $this->hasUsage( $usages->getUsages(), 
$itemId, EntityUsage::TITLE_USAGE ), 'title usage' );
-               $this->assertFalse( $this->hasUsage( $usages->getUsages(), 
$itemId, EntityUsage::ALL_USAGE ), 'all usage' );
+               $this->assertFalse(
+                       $this->hasUsage( $usages->getUsages(), $itemId, 
EntityUsage::TITLE_USAGE ),
+                       'title usage'
+               );
+
+               $this->assertFalse(
+                       $this->hasUsage( $usages->getUsages(), $itemId, 
EntityUsage::ALL_USAGE ),
+                       'all usage'
+               );
        }
 
        public function getDescriptionProvider() {
@@ -110,25 +164,54 @@
         * @param string $itemId
         */
        public function testGetDescription( $expected, $itemId ) {
-               $wikibaseLuaBindings = 
$this->getWikibaseLanguageDependentLuaBindings();
+               $wikibaseLuaBindings = 
$this->getWikibaseLanguageDependentLuaBindings(
+                       $this->getLabelDescriptionLookup()
+               );
 
                $this->assertSame( $expected, 
$wikibaseLuaBindings->getDescription( $itemId ) );
+       }
+
+       public function testGetDescriptionWithFallback() {
+               $wikibaseLuaBindings = 
$this->getWikibaseLanguageDependentLuaBindings(
+                       $this->getLabelDescriptionLookupWithFallback()
+               );
+
+               $this->assertSame(
+                       [ 'en-desc-fallback', 'en' ],
+                       $wikibaseLuaBindings->getDescription( 'Q1234' )
+               );
        }
 
        public function testGetDescription_usage() {
                $usages = new HashUsageAccumulator();
 
                $wikibaseLuaBindings = 
$this->getWikibaseLanguageDependentLuaBindings(
+                       $this->getLabelDescriptionLookup(),
                        $usages
                );
 
                $itemId = new ItemId( 'Q7' );
                $wikibaseLuaBindings->getDescription( 
$itemId->getSerialization() );
 
-               $this->assertTrue( $this->hasUsage( $usages->getUsages(), 
$itemId, EntityUsage::OTHER_USAGE ), 'other usage' );
-               $this->assertFalse( $this->hasUsage( $usages->getUsages(), 
$itemId, EntityUsage::LABEL_USAGE ), 'label usage' );
-               $this->assertFalse( $this->hasUsage( $usages->getUsages(), 
$itemId, EntityUsage::TITLE_USAGE ), 'title usage' );
-               $this->assertFalse( $this->hasUsage( $usages->getUsages(), 
$itemId, EntityUsage::ALL_USAGE ), 'all usage' );
+               $this->assertTrue(
+                       $this->hasUsage( $usages->getUsages(), $itemId, 
EntityUsage::OTHER_USAGE ),
+                       'other usage'
+               );
+
+               $this->assertFalse(
+                       $this->hasUsage( $usages->getUsages(), $itemId, 
EntityUsage::LABEL_USAGE ),
+                       'label usage'
+               );
+
+               $this->assertFalse(
+                       $this->hasUsage( $usages->getUsages(), $itemId, 
EntityUsage::TITLE_USAGE ),
+                       'title usage'
+               );
+
+               $this->assertFalse(
+                       $this->hasUsage( $usages->getUsages(), $itemId, 
EntityUsage::ALL_USAGE ),
+                       'all usage'
+               );
        }
 
 }
diff --git 
a/extensions/Wikibase/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php
 
b/extensions/Wikibase/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php
index 813aa51..a41ffc1 100644
--- 
a/extensions/Wikibase/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php
+++ 
b/extensions/Wikibase/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php
@@ -176,18 +176,16 @@
                $lookup->expects( $this->any() )
                        ->method( 'getEntityRevision' )
                        ->will( $this->returnCallback( function( EntityId 
$entityId ) {
-                               if ( $entityId->getSerialization() === 'Q42' ) {
-                                       return new EntityRevision(
-                                               new Item( new ItemId( 'Q42' ) )
-                                       );
-                               } elseif ( $entityId->getSerialization() === 
'Q43' ) {
-                                       // Unresolved redirect, derived from 
EntityLookupException
-                                       throw new 
RevisionedUnresolvedRedirectException(
-                                               $entityId,
-                                               new ItemId( 'Q404' )
-                                       );
-                               } else {
-                                       return null;
+                               switch ( $entityId->getSerialization() ) {
+                                       case 'Q42':
+                                               return new EntityRevision( new 
Item( new ItemId( 'Q42' ) ) );
+                                       case 'Q43':
+                                               throw new 
RevisionedUnresolvedRedirectException(
+                                                       $entityId,
+                                                       new ItemId( 'Q404' )
+                                               );
+                                       default:
+                                               return null;
                                }
                        } )
                );
diff --git 
a/extensions/Wikibase/client/tests/phpunit/includes/Hooks/EditActionHookHandlerTest.php
 
b/extensions/Wikibase/client/tests/phpunit/includes/Hooks/EditActionHookHandlerTest.php
index 42cb906..57c206d 100644
--- 
a/extensions/Wikibase/client/tests/phpunit/includes/Hooks/EditActionHookHandlerTest.php
+++ 
b/extensions/Wikibase/client/tests/phpunit/includes/Hooks/EditActionHookHandlerTest.php
@@ -102,7 +102,16 @@
 
                $repoLinker->expects( $this->any() )
                        ->method( 'buildEntityLink' )
-                       ->will( $this->returnCallback( [ $this, 
'buildEntityLink' ] ) );
+                       ->will( $this->returnCallback( function (
+                               EntityId $entityId,
+                               array $classes = [],
+                               $text = null
+                       ) {
+                               return Html::rawElement( 'a', [
+                                       'href' => 
'https://www.wikidata.org/wiki/' . $entityId,
+                                       'class' => implode( ' ', $classes ),
+                               ], $text ?: $entityId );
+                       } ) );
 
                $siteLinkLookup = $this->getMockBuilder( SiteLinkLookup::class )
                        ->disableOriginalConstructor()
@@ -137,7 +146,9 @@
 
                $idParser->expects( $this->any() )
                        ->method( 'parse' )
-                       ->will( $this->returnCallback( [ $this, 'parse' ] ) );
+                       ->will( $this->returnCallback( function ( 
$idSerialization ) {
+                               return new ItemId( $idSerialization );
+                       } ) );
 
                $hookHandler = new EditActionHookHandler(
                        $repoLinker,
@@ -174,54 +185,16 @@
 
                $lookup->expects( $this->any() )
                        ->method( 'getLabel' )
-                       ->will( $this->returnCallback( [ $this, 'getLabel' ] ) 
);
+                       ->will( $this->returnCallback( function ( EntityId 
$entityId ) {
+                               switch ( $entityId->getSerialization() ) {
+                                       case 'Q4':
+                                               return new Term( 'en', 'Berlin' 
);
+                                       default:
+                                               return null;
+                               }
+                       } ) );
 
                return $lookup;
-       }
-
-       /**
-        * @param EntityId $entity
-        *
-        * @return Term|null
-        */
-       public function getLabel( EntityId $entity ) {
-               $labelMap = [ 'Q4' => 'Berlin' ];
-               $idSerialization = $entity->getSerialization();
-               if ( !isset( $labelMap[$idSerialization] ) ) {
-                       return null;
-               }
-               $term = new Term( 'en', $labelMap[$idSerialization] );
-               return $term;
-       }
-
-       /**
-        * @param string $entity
-        *
-        * @return ItemId
-        */
-       public function parse( $entity ) {
-               // TODO: Let properties be tested too
-               return new ItemId( $entity );
-       }
-
-       /**
-        * @param string $entityId
-        * @param string[] $classes
-        * @param string|null $text
-        *
-        * @return string HTML
-        */
-       public function buildEntityLink( $entityId, array $classes, $text = 
null ) {
-               if ( $text === null ) {
-                       $text = $entityId;
-               }
-
-               $attr = [
-                       'href' => 'https://www.wikidata.org/wiki/' . $entityId,
-                       'class' => implode( ' ', $classes )
-               ];
-
-               return Html::rawElement( 'a', $attr, $text );
        }
 
        /**
diff --git 
a/extensions/Wikibase/client/tests/phpunit/includes/Hooks/InfoActionHookHandlerTest.php
 
b/extensions/Wikibase/client/tests/phpunit/includes/Hooks/InfoActionHookHandlerTest.php
index 0230e8c..f2e8ed5 100644
--- 
a/extensions/Wikibase/client/tests/phpunit/includes/Hooks/InfoActionHookHandlerTest.php
+++ 
b/extensions/Wikibase/client/tests/phpunit/includes/Hooks/InfoActionHookHandlerTest.php
@@ -9,6 +9,7 @@
 use Wikibase\Client\Hooks\InfoActionHookHandler;
 use Wikibase\Client\RepoLinker;
 use Wikibase\Client\Usage\Sql\SqlUsageTracker;
+use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Entity\EntityIdParser;
 use Wikibase\DataModel\Entity\ItemId;
 use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup;
@@ -42,9 +43,9 @@
 
        public function handleProvider() {
                $context = $this->getContext();
-               $labeledLink = '<a href="https://www.wikidata.org/wiki/Q4"; 
classes="external">Berlin</a>';
-               $unLabeledLink = '<a href="https://www.wikidata.org/wiki/Q4"; 
classes="external">Q4</a>';
-               $q5Link = '<a href="https://www.wikidata.org/wiki/Q5"; 
classes="external">Q5</a>';
+               $labeledLink = '<a href="https://www.wikidata.org/wiki/Q4"; 
class="external">Berlin</a>';
+               $unLabeledLink = '<a href="https://www.wikidata.org/wiki/Q4"; 
class="external">Q4</a>';
+               $q5Link = '<a href="https://www.wikidata.org/wiki/Q5"; 
class="external">Q5</a>';
                $cases = [];
 
                $cases[] = [
@@ -134,7 +135,16 @@
 
                $repoLinker->expects( $this->any() )
                        ->method( 'buildEntityLink' )
-                       ->will( $this->returnCallback( [ $this, 
'buildEntityLink' ] ) );
+                       ->will( $this->returnCallback( function (
+                               EntityId $entityId,
+                               array $classes = [],
+                               $text = null
+                       ) {
+                               return Html::rawElement( 'a', [
+                                       'href' => 
'https://www.wikidata.org/wiki/' . $entityId,
+                                       'class' => implode( ' ', $classes ),
+                               ], $text ?: $entityId );
+                       } ) );
 
                $siteLinkLookup = $this->getMockBuilder( SiteLinkLookup::class )
                        ->disableOriginalConstructor()
@@ -171,7 +181,9 @@
 
                $idParser->expects( $this->any() )
                        ->method( 'parse' )
-                       ->will( $this->returnCallback( [ $this, 'parse' ] ) );
+                       ->will( $this->returnCallback( function ( 
$idSerialization ) {
+                               return new ItemId( $idSerialization );
+                       } ) );
 
                $hookHandler = new InfoActionHookHandler(
                        $namespaceChecker,
@@ -224,54 +236,16 @@
 
                $lookup->expects( $this->any() )
                        ->method( 'getLabel' )
-                       ->will( $this->returnCallback( [ $this, 'getLabel' ] ) 
);
+                       ->will( $this->returnCallback( function ( EntityId 
$entityId ) {
+                               switch ( $entityId->getSerialization() ) {
+                                       case 'Q4':
+                                               return new Term( 'en', 'Berlin' 
);
+                                       default:
+                                               return null;
+                               }
+                       } ) );
 
                return $lookup;
-       }
-
-       /**
-        * @param EntityId $entity
-        *
-        * @return Term|null
-        */
-       public function getLabel( $entity ) {
-               $labelMap = [ 'Q4' => 'Berlin' ];
-               $entityId = $entity->getSerialization();
-               if ( !isset( $labelMap[$entityId] ) ) {
-                       return null;
-               }
-               $term = new Term( 'en', $labelMap[$entityId] );
-               return $term;
-       }
-
-       /**
-        * @param string $entity
-        *
-        * @return ItemId
-        */
-       public function parse( $entity ) {
-               // TODO: Let properties be tested too
-               return new ItemId( $entity );
-       }
-
-       /**
-        * @param string $entityId
-        * @param string[] $classes
-        * @param string $text
-        *
-        * @return string HTML
-        */
-       public function buildEntityLink( $entityId, array $classes, $text = 
null ) {
-               if ( $text === null ) {
-                       $text = $entityId;
-               }
-
-               $attr = [
-                       'href' => 'https://www.wikidata.org/wiki/' . $entityId,
-                       'classes' => implode( ' ', $classes )
-               ];
-
-               return Html::rawElement( 'a', $attr, $text );
        }
 
 }
diff --git 
a/extensions/Wikibase/client/tests/phpunit/includes/Hooks/LanguageLinkBadgeDisplayTest.php
 
b/extensions/Wikibase/client/tests/phpunit/includes/Hooks/LanguageLinkBadgeDisplayTest.php
index 979457a..25951e7 100644
--- 
a/extensions/Wikibase/client/tests/phpunit/includes/Hooks/LanguageLinkBadgeDisplayTest.php
+++ 
b/extensions/Wikibase/client/tests/phpunit/includes/Hooks/LanguageLinkBadgeDisplayTest.php
@@ -39,13 +39,14 @@
                $labelLookup->expects( $this->any() )
                        ->method( 'getLabel' )
                        ->will( $this->returnCallback( function( EntityId 
$entityId ) {
-                               if ( $entityId->getSerialization() === 'Q3' ) {
-                                       return new Term( 'de', 'Lesenswerter 
Artikel' );
-                               } elseif ( $entityId->getSerialization() === 
'Q4' ) {
-                                       return new Term( 'de', 'Exzellenter 
Artikel' );
+                               switch ( $entityId->getSerialization() ) {
+                                       case 'Q3':
+                                               return new Term( 'de', 
'Lesenswerter Artikel' );
+                                       case 'Q4':
+                                               return new Term( 'de', 
'Exzellenter Artikel' );
+                                       default:
+                                               return null;
                                }
-
-                               return null;
                        } ) );
 
                $badgeClassNames = array( 'Q4' => 'foo', 'Q3' => 'bar' );
diff --git 
a/extensions/Wikibase/lib/includes/Store/ForeignEntityRevisionLookupFactory.php 
b/extensions/Wikibase/lib/includes/Store/RepositorySpecificEntityRevisionLookupFactory.php
similarity index 89%
rename from 
extensions/Wikibase/lib/includes/Store/ForeignEntityRevisionLookupFactory.php
rename to 
extensions/Wikibase/lib/includes/Store/RepositorySpecificEntityRevisionLookupFactory.php
index 365f7fd..a66339f 100644
--- 
a/extensions/Wikibase/lib/includes/Store/ForeignEntityRevisionLookupFactory.php
+++ 
b/extensions/Wikibase/lib/includes/Store/RepositorySpecificEntityRevisionLookupFactory.php
@@ -2,10 +2,8 @@
 
 namespace Wikibase\Lib\Store;
 
-use DataValues\Deserializers\DataValueDeserializer;
 use Serializers\Serializer;
 use Wikibase\DataModel\Assert\RepositoryNameAssert;
-use Wikibase\DataModel\Entity\EntityIdParser;
 use Wikibase\DataModel\Services\EntityId\PrefixMappingEntityIdParserFactory;
 use Wikibase\DataModel\Services\Lookup\UnknownForeignRepositoryException;
 use Wikibase\InternalSerialization\DeserializerFactory;
@@ -16,11 +14,11 @@
 use Wikimedia\Assert\ParameterAssertionException;
 
 /**
- * A factory providing the WikiPageEntityMetaDataLookup instance configured 
for the given foreign repository.
+ * A factory providing the WikiPageEntityRevisionLookup instance configured 
for the given repository.
  *
  * @license GPL-2.0+
  */
-class ForeignEntityRevisionLookupFactory {
+class RepositorySpecificEntityRevisionLookupFactory {
 
        /**
         * @var PrefixMappingEntityIdParserFactory
@@ -76,9 +74,11 @@
                $maxBlobSize,
                array $databaseNames
        ) {
+               Assert::parameter( !empty( $databaseNames ), '$databaseNames', 
'must not be empty' );
+               foreach ( $databaseNames as $name ) {
+                       Assert::parameter( is_string( $name ) || $name === 
false, 'values of $databaseNames', 'must be either string or false' );
+               }
                
RepositoryNameAssert::assertParameterKeysAreValidRepositoryNames( 
$databaseNames, '$databaseNames' );
-               Assert::parameterElementType( 'string', $databaseNames, 
'$databaseNames' );
-               Assert::parameter( !array_key_exists( '', $databaseNames ), 
'$databaseNames', 'must not contain an empty string key' );
 
                $this->parserFactory = $parserFactory;
                $this->entitySerializer = $entitySerializer;
diff --git 
a/extensions/Wikibase/lib/tests/phpunit/Formatters/EntityIdLinkFormatterTest.php
 
b/extensions/Wikibase/lib/tests/phpunit/Formatters/EntityIdLinkFormatterTest.php
index 0038233..d0a7379 100644
--- 
a/extensions/Wikibase/lib/tests/phpunit/Formatters/EntityIdLinkFormatterTest.php
+++ 
b/extensions/Wikibase/lib/tests/phpunit/Formatters/EntityIdLinkFormatterTest.php
@@ -44,7 +44,7 @@
                $formatter = $this->newEntityIdLinkFormatter();
 
                $actual = $formatter->formatEntityId( $id );
-               $this->assertEquals( $expected, $actual );
+               $this->assertSame( $expected, $actual );
        }
 
        public function getTitleForId( EntityId $entityId ) {
@@ -60,7 +60,8 @@
 
        private function newEntityIdLinkFormatter() {
                $titleLookup = $this->getMock( EntityTitleLookup::class );
-               $titleLookup->expects( $this->any() )->method( 'getTitleForId' )
+               $titleLookup->expects( $this->any() )
+                       ->method( 'getTitleForId' )
                        ->will( $this->returnCallback( array( $this, 
'getTitleForId' ) ) );
 
                $formatter = new EntityIdLinkFormatter( $titleLookup );
diff --git 
a/extensions/Wikibase/lib/tests/phpunit/Formatters/EntityIdPlainLinkFormatterTest.php
 
b/extensions/Wikibase/lib/tests/phpunit/Formatters/EntityIdPlainLinkFormatterTest.php
index 3d0ce51..7ac4971 100644
--- 
a/extensions/Wikibase/lib/tests/phpunit/Formatters/EntityIdPlainLinkFormatterTest.php
+++ 
b/extensions/Wikibase/lib/tests/phpunit/Formatters/EntityIdPlainLinkFormatterTest.php
@@ -45,7 +45,7 @@
                $formatter = $this->newEntityIdLinkFormatter();
 
                $actual = $formatter->formatEntityId( $id );
-               $this->assertEquals( $expected, $actual );
+               $this->assertSame( $expected, $actual );
        }
 
        public function getTitleForId( EntityId $entityId ) {
@@ -61,7 +61,8 @@
 
        private function newEntityIdLinkFormatter() {
                $titleLookup = $this->getMock( EntityTitleLookup::class );
-               $titleLookup->expects( $this->any() )->method( 'getTitleForId' )
+               $titleLookup->expects( $this->any() )
+                       ->method( 'getTitleForId' )
                        ->will( $this->returnCallback( array( $this, 
'getTitleForId' ) ) );
 
                $formatter = new EntityIdPlainLinkFormatter( $titleLookup );
diff --git 
a/extensions/Wikibase/lib/tests/phpunit/Formatters/EntityIdTitleFormatterTest.php
 
b/extensions/Wikibase/lib/tests/phpunit/Formatters/EntityIdTitleFormatterTest.php
index 3efc09d..727c843 100644
--- 
a/extensions/Wikibase/lib/tests/phpunit/Formatters/EntityIdTitleFormatterTest.php
+++ 
b/extensions/Wikibase/lib/tests/phpunit/Formatters/EntityIdTitleFormatterTest.php
@@ -46,7 +46,7 @@
                $formatter = $this->newEntityIdTitleFormatter();
 
                $actual = $formatter->formatEntityId( $id );
-               $this->assertEquals( $expected, $actual );
+               $this->assertSame( $expected, $actual );
        }
 
        public function getTitleForId( EntityId $entityId ) {
@@ -62,7 +62,8 @@
 
        protected function newEntityIdTitleFormatter() {
                $titleLookup = $this->getMock( EntityTitleLookup::class );
-               $titleLookup->expects( $this->any() )->method( 'getTitleForId' )
+               $titleLookup->expects( $this->any() )
+                       ->method( 'getTitleForId' )
                        ->will( $this->returnCallback( array( $this, 
'getTitleForId' ) ) );
 
                $formatter = new EntityIdTitleFormatter( $titleLookup );
diff --git 
a/extensions/Wikibase/lib/tests/phpunit/Store/ForeignEntityRevisionLookupFactoryTest.php
 
b/extensions/Wikibase/lib/tests/phpunit/Store/RepositorySpecificEntityRevisionLookupFactoryTest.php
similarity index 80%
rename from 
extensions/Wikibase/lib/tests/phpunit/Store/ForeignEntityRevisionLookupFactoryTest.php
rename to 
extensions/Wikibase/lib/tests/phpunit/Store/RepositorySpecificEntityRevisionLookupFactoryTest.php
index c990a46..d8588a7 100644
--- 
a/extensions/Wikibase/lib/tests/phpunit/Store/ForeignEntityRevisionLookupFactoryTest.php
+++ 
b/extensions/Wikibase/lib/tests/phpunit/Store/RepositorySpecificEntityRevisionLookupFactoryTest.php
@@ -9,19 +9,19 @@
 use Wikibase\DataModel\Services\Lookup\UnknownForeignRepositoryException;
 use Wikibase\Lib\Serialization\RepositorySpecificDataValueDeserializerFactory;
 use Wikibase\Lib\Store\EntityNamespaceLookup;
-use Wikibase\Lib\Store\ForeignEntityRevisionLookupFactory;
+use Wikibase\Lib\Store\RepositorySpecificEntityRevisionLookupFactory;
 use Wikibase\Lib\Store\WikiPageEntityRevisionLookup;
 use Wikimedia\Assert\ParameterAssertionException;
 
 /**
- * @covers Wikibase\Lib\Store\ForeignEntityRevisionLookupFactory
+ * @covers Wikibase\Lib\Store\RepositorySpecificEntityRevisionLookupFactory
  *
  * @group Wikibase
  * @group WikibaseLib
  *
  * @license GPL-2.0+
  */
-class ForeignEntityRevisionLookupFactoryTest extends 
\PHPUnit_Framework_TestCase {
+class RepositorySpecificEntityRevisionLookupFactoryTest extends 
\PHPUnit_Framework_TestCase {
 
        /**
         * @return EntityIdParser
@@ -70,8 +70,21 @@
                return new EntityNamespaceLookup( [ 'item' => 100 ] );
        }
 
+       public function 
testGivenLocalRepositoryAndDatabase_getLookupReturnsInstanceOfWikiPageEntityRevisionLookup()
 {
+               $factory = new RepositorySpecificEntityRevisionLookupFactory(
+                       $this->getPrefixMappingEntityIdParserFactory(),
+                       $this->getEntitySerializer(),
+                       $this->getDataValueDeserializerFactory(),
+                       $this->getEntityNamespaceLookup(),
+                       0,
+                       [ '' => '' ]
+               );
+
+               $this->assertInstanceOf( WikiPageEntityRevisionLookup::class, 
$factory->getLookup( '' ) );
+       }
+
        public function 
testGivenKnownRepository_getLookupReturnsInstanceOfWikiPageEntityRevisionLookup()
 {
-               $factory = new ForeignEntityRevisionLookupFactory(
+               $factory = new RepositorySpecificEntityRevisionLookupFactory(
                        $this->getPrefixMappingEntityIdParserFactory(),
                        $this->getEntitySerializer(),
                        $this->getDataValueDeserializerFactory(),
@@ -84,7 +97,7 @@
        }
 
        public function testGivenUnknownRepository_getLookupThrowsException() {
-               $factory = new ForeignEntityRevisionLookupFactory(
+               $factory = new RepositorySpecificEntityRevisionLookupFactory(
                        $this->getPrefixMappingEntityIdParserFactory(),
                        $this->getEntitySerializer(),
                        $this->getDataValueDeserializerFactory(),
@@ -99,7 +112,7 @@
        }
 
        public function testGetLookupReusesTheInstanceOverMultipleCalls() {
-               $factory = new ForeignEntityRevisionLookupFactory(
+               $factory = new RepositorySpecificEntityRevisionLookupFactory(
                        $this->getPrefixMappingEntityIdParserFactory(),
                        $this->getEntitySerializer(),
                        $this->getDataValueDeserializerFactory(),
@@ -116,10 +129,9 @@
 
        public function provideInvalidDatabaseNamesValue() {
                return [
+                       'empty list' => [ [] ],
                        'repository name containing a colon' => [ [ 'fo:o' => 
'foodb' ] ],
-                       'providing database name for local repository' => [ [ 
'' => 'foodb' ] ],
                        'non-string key' => [ [ 0 => 'foodb' ] ],
-                       'not a string as a database name (false)' => [ [ 'foo' 
=> false ] ],
                        'not a string as a database name (true)' => [ [ 'foo' 
=> true ] ],
                        'not a string as a database name (null)' => [ [ 'foo' 
=> null ] ],
                        'not a string as a database name (int)' => [ [ 'foo' => 
100 ] ],
@@ -132,7 +144,7 @@
        public function testGivenInvalidDatabaseNamesValue_exceptionIsThrown( 
array $databaseNames ) {
                $this->setExpectedException( ParameterAssertionException::class 
);
 
-               new ForeignEntityRevisionLookupFactory(
+               new RepositorySpecificEntityRevisionLookupFactory(
                        $this->getPrefixMappingEntityIdParserFactory(),
                        $this->getEntitySerializer(),
                        $this->getDataValueDeserializerFactory(),
diff --git a/extensions/Wikibase/repo/includes/Api/SetClaimValue.php 
b/extensions/Wikibase/repo/includes/Api/SetClaimValue.php
index b9f2362..dd1cc1a 100644
--- a/extensions/Wikibase/repo/includes/Api/SetClaimValue.php
+++ b/extensions/Wikibase/repo/includes/Api/SetClaimValue.php
@@ -93,7 +93,7 @@
 
                $claim = $this->modificationHelper->getStatementFromEntity( 
$guid, $entity );
 
-               $snak = $this->modificationHelper->getSnakInstance( $params, 
$claim->getMainSnak()->getPropertyId() );
+               $snak = $this->modificationHelper->getSnakInstance( $params, 
$claim->getPropertyId() );
 
                $summary = $this->modificationHelper->createSummary( $params, 
$this );
 
diff --git a/extensions/Wikibase/repo/includes/ChangeOp/ChangeOpMainSnak.php 
b/extensions/Wikibase/repo/includes/ChangeOp/ChangeOpMainSnak.php
index 94b353d..8238c48 100644
--- a/extensions/Wikibase/repo/includes/ChangeOp/ChangeOpMainSnak.php
+++ b/extensions/Wikibase/repo/includes/ChangeOp/ChangeOpMainSnak.php
@@ -123,7 +123,7 @@
                        throw new ChangeOpException( "Entity does not have a 
statement with GUID " . $this->statementGuid );
                }
 
-               $propertyId = $statement->getMainSnak()->getPropertyId();
+               $propertyId = $statement->getPropertyId();
 
                if ( !$propertyId->equals( $this->snak->getPropertyId() ) ) {
                        throw new ChangeOpException( "Claim with GUID "
diff --git a/extensions/Wikibase/repo/includes/ChangeOp/ChangeOpStatement.php 
b/extensions/Wikibase/repo/includes/ChangeOp/ChangeOpStatement.php
index abb7019..63c98ee 100644
--- a/extensions/Wikibase/repo/includes/ChangeOp/ChangeOpStatement.php
+++ b/extensions/Wikibase/repo/includes/ChangeOp/ChangeOpStatement.php
@@ -183,7 +183,7 @@
         */
        private function checkMainSnakUpdate( Statement $oldStatement ) {
                $newMainSnak = $this->statement->getMainSnak();
-               $oldPropertyId = $oldStatement->getMainSnak()->getPropertyId();
+               $oldPropertyId = $oldStatement->getPropertyId();
 
                if ( !$oldPropertyId->equals( $newMainSnak->getPropertyId() ) ) 
{
                        $guid = $this->statement->getGuid();
diff --git 
a/extensions/Wikibase/repo/includes/ParserOutput/GeoDataDataUpdater.php 
b/extensions/Wikibase/repo/includes/ParserOutput/GeoDataDataUpdater.php
index 341ba24..33908b9 100644
--- a/extensions/Wikibase/repo/includes/ParserOutput/GeoDataDataUpdater.php
+++ b/extensions/Wikibase/repo/includes/ParserOutput/GeoDataDataUpdater.php
@@ -77,7 +77,7 @@
         * @param Statement $statement
         */
        public function processStatement( Statement $statement ) {
-               $propertyId = $statement->getMainSnak()->getPropertyId();
+               $propertyId = $statement->getPropertyId();
 
                if ( $this->propertyDataTypeMatcher->isMatchingDataType(
                        $propertyId,
diff --git a/extensions/Wikibase/repo/includes/WikibaseRepo.php 
b/extensions/Wikibase/repo/includes/WikibaseRepo.php
index aa7c764..3060a1a 100644
--- a/extensions/Wikibase/repo/includes/WikibaseRepo.php
+++ b/extensions/Wikibase/repo/includes/WikibaseRepo.php
@@ -77,6 +77,7 @@
 use Wikibase\Lib\PropertyInfoDataTypeLookup;
 use Wikibase\Lib\SnakFormatter;
 use Wikibase\Lib\StaticContentLanguages;
+use Wikibase\Lib\Store\CachingPropertyOrderProvider;
 use Wikibase\Lib\Store\EntityContentDataCodec;
 use Wikibase\Lib\Store\EntityNamespaceLookup;
 use Wikibase\Lib\Store\EntityRevisionLookup;
@@ -84,6 +85,7 @@
 use Wikibase\Lib\Store\EntityStoreWatcher;
 use Wikibase\Lib\Store\EntityTitleLookup;
 use Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookupFactory;
+use Wikibase\Lib\Store\WikiPagePropertyOrderProvider;
 use Wikibase\Lib\UnionContentLanguages;
 use Wikibase\Lib\UnitConverter;
 use Wikibase\Lib\UnitStorage;
@@ -1636,11 +1638,19 @@
                        $this->getStatementGuidParser()
                );
 
+               $propertyOrderProvider = new CachingPropertyOrderProvider(
+                       new WikiPagePropertyOrderProvider(
+                               Title::newFromText( 
'MediaWiki:Wikibase-SortedProperties' )
+                       ),
+                       wfGetMainCache()
+               );
+
                return new ViewFactory(
                        $this->getEntityIdHtmlLinkFormatterFactory(),
                        new EntityIdLabelFormatterFactory(),
                        $this->getHtmlSnakFormatterFactory(),
                        $statementGrouperBuilder->getStatementGrouper(),
+                       $propertyOrderProvider,
                        $this->getSiteStore(),
                        $this->getDataTypeFactory(),
                        TemplateFactory::getDefaultInstance(),
diff --git 
a/extensions/Wikibase/repo/tests/phpunit/includes/Api/EntitySearchHelperTest.php
 
b/extensions/Wikibase/repo/tests/phpunit/includes/Api/EntitySearchHelperTest.php
index eb297fe..2face6e 100644
--- 
a/extensions/Wikibase/repo/tests/phpunit/includes/Api/EntitySearchHelperTest.php
+++ 
b/extensions/Wikibase/repo/tests/phpunit/includes/Api/EntitySearchHelperTest.php
@@ -31,13 +31,11 @@
         */
        private function getMockTitleLookup() {
                $titleLookup = $this->getMock( EntityTitleLookup::class );
-               $titleLookup->expects( $this->any() )->method( 'getTitleForId' )
+               $titleLookup->expects( $this->any() )
+                       ->method( 'getTitleForId' )
                        ->will( $this->returnCallback( function( EntityId $id ) 
{
-                               if ( $id->getSerialization() === 'Q111' ) {
-                                       return $this->getMockTitle( true );
-                               } else {
-                                       return $this->getMockTitle( false );
-                               }
+                               $exists = $id->getSerialization() === 'Q111';
+                               return $this->getMockTitle( $exists );
                        } ) );
                return $titleLookup;
        }
diff --git 
a/extensions/Wikibase/repo/tests/phpunit/includes/Api/QuerySearchEntitiesTest.php
 
b/extensions/Wikibase/repo/tests/phpunit/includes/Api/QuerySearchEntitiesTest.php
index 887c618..7e73765 100644
--- 
a/extensions/Wikibase/repo/tests/phpunit/includes/Api/QuerySearchEntitiesTest.php
+++ 
b/extensions/Wikibase/repo/tests/phpunit/includes/Api/QuerySearchEntitiesTest.php
@@ -49,7 +49,8 @@
         */
        private function getMockTitleLookup() {
                $titleLookup = $this->getMock( EntityTitleLookup::class );
-               $titleLookup->expects( $this->any() )->method( 'getTitleForId' )
+               $titleLookup->expects( $this->any() )
+                       ->method( 'getTitleForId' )
                        ->will( $this->returnValue( $this->getMockTitle() ) );
 
                return $titleLookup;
diff --git 
a/extensions/Wikibase/repo/tests/phpunit/includes/Api/SearchEntitiesTest.php 
b/extensions/Wikibase/repo/tests/phpunit/includes/Api/SearchEntitiesTest.php
index a32017b..ae46296 100644
--- a/extensions/Wikibase/repo/tests/phpunit/includes/Api/SearchEntitiesTest.php
+++ b/extensions/Wikibase/repo/tests/phpunit/includes/Api/SearchEntitiesTest.php
@@ -50,7 +50,8 @@
         */
        private function getMockTitleLookup() {
                $titleLookup = $this->getMock( EntityTitleLookup::class );
-               $titleLookup->expects( $this->any() )->method( 'getTitleForId' )
+               $titleLookup->expects( $this->any() )
+                       ->method( 'getTitleForId' )
                        ->will( $this->returnValue( $this->getMockTitle() ) );
 
                return $titleLookup;
diff --git 
a/extensions/Wikibase/repo/tests/phpunit/includes/ChangeDispatcherTest.php 
b/extensions/Wikibase/repo/tests/phpunit/includes/ChangeDispatcherTest.php
index 110fb3a..c173e37 100644
--- a/extensions/Wikibase/repo/tests/phpunit/includes/ChangeDispatcherTest.php
+++ b/extensions/Wikibase/repo/tests/phpunit/includes/ChangeDispatcherTest.php
@@ -7,6 +7,7 @@
 use Diff\DiffOp\DiffOpAdd;
 use Diff\DiffOp\DiffOpChange;
 use Diff\DiffOp\DiffOpRemove;
+use PHPUnit_Framework_MockObject_Matcher_Invocation;
 use Wikibase\Change;
 use Wikibase\ChunkAccess;
 use Wikibase\DataModel\Entity\EntityId;
@@ -60,7 +61,7 @@
                $dispatcher = new ChangeDispatcher(
                        $coordinator,
                        $this->getNotificationSender( $notifications ),
-                       $this->getChunkedChangesAccess(),
+                       $this->getChunkedChangesAccess( $this->any() ),
                        $this->getSubscriptionLookup()
                );
 
@@ -86,14 +87,20 @@
        }
 
        /**
+        * @param PHPUnit_Framework_MockObject_Matcher_Invocation|null 
$expectedLoadChunkCalls
+        *
         * @return ChunkAccess Guaranteed to only return Change objects from 
loadChunk.
         */
-       private function getChunkedChangesAccess() {
+       private function getChunkedChangesAccess(
+               PHPUnit_Framework_MockObject_Matcher_Invocation 
$expectedLoadChunkCalls = null
+       ) {
                $chunkedAccess = $this->getMock( ChunkAccess::class );
 
-               $chunkedAccess->expects( $this->any() )
+               $chunkedAccess->expects( $expectedLoadChunkCalls ?: 
$this->never() )
                        ->method( 'loadChunk' )
-                       ->will( $this->returnCallback( array( $this, 
'getChanges' ) ) );
+                       ->will( $this->returnCallback( function ( $fromId, 
$limit ) {
+                               return array_slice( $this->changes, $fromId, 
$limit );
+                       } ) );
 
                $chunkedAccess->expects( $this->any() )
                        ->method( 'getRecordId' )
@@ -112,21 +119,13 @@
 
                $lookup->expects( $this->any() )
                        ->method( 'getSubscriptions' )
-                       ->will( $this->returnCallback( array( $this, 
'getSubscriptions' ) ) );
+                       ->will( $this->returnCallback( function ( $siteId, 
array $entityIds ) {
+                               return isset( $this->subscriptions[$siteId] )
+                                       ? array_intersect( 
$this->subscriptions[$siteId], $entityIds )
+                                       : [];
+                       } ) );
 
                return $lookup;
-       }
-
-       public function getChanges( $fromId, $limit ) {
-               return array_slice( $this->changes, max( $fromId, 1 ), $limit );
-       }
-
-       public function getSubscriptions( $siteId, array $entityIds ) {
-               if ( !isset( $this->subscriptions[$siteId] ) ) {
-                       return array();
-               }
-
-               return array_intersect( $this->subscriptions[$siteId], 
$entityIds );
        }
 
        /**
@@ -341,26 +340,14 @@
                $pending = $dispatcher->getPendingChanges( $siteId, $afterId );
 
                $this->assertChanges( $expectedChanges, $pending[0] );
-               $this->assertEquals( $expectedSeen, $pending[1] );
+               $this->assertSame( $expectedSeen, $pending[1] );
        }
 
        public function testGetPendingChanges_maxChunks() {
-               $chunkAccess = $this->getMock( ChunkAccess::class );
-
-               $chunkAccess->expects( $this->exactly( 1 ) )
-                       ->method( 'loadChunk' )
-                       ->will( $this->returnCallback( array( $this, 
'getChanges' ) ) );
-
-               $chunkAccess->expects( $this->any() )
-                       ->method( 'getRecordId' )
-                       ->will( $this->returnCallback( function ( Change 
$change ) {
-                               return $change->getId();
-                       } ) );
-
                $dispatcher = new ChangeDispatcher(
                        $this->getMock( ChangeDispatchCoordinator::class ),
                        $this->getNotificationSender(),
-                       $chunkAccess,
+                       $this->getChunkedChangesAccess( $this->exactly( 1 ) ),
                        $this->getSubscriptionLookup()
                );
 
@@ -460,12 +447,21 @@
                $this->assertNotifications( $expectedNotifications, 
$notifications );
        }
 
+       /**
+        * @param Change[] $changes
+        *
+        * @return int[]
+        */
        private function getChangeIds( array $changes ) {
                return array_map( function( Change $change ) {
                        return $change->getId();
                }, $changes );
        }
 
+       /**
+        * @param Change[] $expected
+        * @param Change[] $actual
+        */
        private function assertChanges( array $expected, $actual ) {
                $expected = $this->getChangeIds( $expected );
                $actual = $this->getChangeIds( $actual );
@@ -473,6 +469,10 @@
                $this->assertEquals( $expected, $actual );
        }
 
+       /**
+        * @param array[] $expected
+        * @param array[] $notifications
+        */
        private function assertNotifications( array $expected, array 
$notifications ) {
                foreach ( $notifications as &$n ) {
                        $n[1] = $this->getChangeIds( $n[1] );
diff --git 
a/extensions/Wikibase/repo/tests/phpunit/includes/Hooks/InfoActionHookHandlerTest.php
 
b/extensions/Wikibase/repo/tests/phpunit/includes/Hooks/InfoActionHookHandlerTest.php
index bebb80a..847da7f 100644
--- 
a/extensions/Wikibase/repo/tests/phpunit/includes/Hooks/InfoActionHookHandlerTest.php
+++ 
b/extensions/Wikibase/repo/tests/phpunit/includes/Hooks/InfoActionHookHandlerTest.php
@@ -114,7 +114,12 @@
 
                $siteLookup->expects( $this->any() )
                        ->method( 'getSite' )
-                       ->will( $this->returnCallback( [ $this, 'getSite' ] ) );
+                       ->will( $this->returnCallback( function () {
+                               $site = new Site();
+                               $site->addInterwikiId( 'en' );
+                               $site->setLinkPath( 
'https://en.wikipedia.org/wiki/$1' );
+                               return $site;
+                       } ) );
 
                $entityIdLookup = $this->getMockBuilder( 
PagePropsEntityIdLookup::class )
                        ->disableOriginalConstructor()
@@ -166,16 +171,6 @@
                $context->setLanguage( 'en' );
 
                return $context;
-       }
-
-       /**
-        * @return Site
-        */
-       public function getSite() {
-               $site = new Site();
-               $site->addInterwikiId( 'en' );
-               $site->setLinkPath( 'https://en.wikipedia.org/wiki/$1' );
-               return $site;
        }
 
 }
diff --git 
a/extensions/Wikibase/repo/tests/phpunit/includes/SummaryFormatterTest.php 
b/extensions/Wikibase/repo/tests/phpunit/includes/SummaryFormatterTest.php
index 2a5c014..e8eceb7 100644
--- a/extensions/Wikibase/repo/tests/phpunit/includes/SummaryFormatterTest.php
+++ b/extensions/Wikibase/repo/tests/phpunit/includes/SummaryFormatterTest.php
@@ -73,8 +73,7 @@
         */
        public function formatSnak( Snak $snak ) {
                if ( $snak instanceof PropertyValueSnak ) {
-                       $value = $snak->getDataValue();
-                       return $this->formatValue( $value );
+                       return $this->formatValue( $snak->getDataValue() );
                } else {
                        return $snak->getType();
                }
@@ -85,19 +84,24 @@
         */
        private function newFormatter() {
                $idFormatter = $this->getMock( EntityIdFormatter::class );
-               $idFormatter->expects( $this->any() )->method( 'formatEntityId' 
)
+               $idFormatter->expects( $this->any() )
+                       ->method( 'formatEntityId' )
                        ->will( $this->returnCallback( array( $this, 'formatId' 
) ) );
 
                $valueFormatter = $this->getMock( ValueFormatter::class );
-               $valueFormatter->expects( $this->any() )->method( 'format' )
+               $valueFormatter->expects( $this->any() )
+                       ->method( 'format' )
                        ->will( $this->returnCallback( array( $this, 
'formatValue' ) ) );
-               $valueFormatter->expects( $this->any() )->method( 'getFormat' )
+               $valueFormatter->expects( $this->any() )
+                       ->method( 'getFormat' )
                        ->will( $this->returnValue( SnakFormatter::FORMAT_PLAIN 
) );
 
                $snakFormatter = $this->getMock( SnakFormatter::class );
-               $snakFormatter->expects( $this->any() )->method( 'formatSnak' )
+               $snakFormatter->expects( $this->any() )
+                       ->method( 'formatSnak' )
                        ->will( $this->returnCallback( array( $this, 
'formatSnak' ) ) );
-               $snakFormatter->expects( $this->any() )->method( 'getFormat' )
+               $snakFormatter->expects( $this->any() )
+                       ->method( 'getFormat' )
                        ->will( $this->returnValue( SnakFormatter::FORMAT_PLAIN 
) );
 
                $language = Language::factory( 'en' );
@@ -128,7 +132,7 @@
 
                $formatter = $this->newFormatter();
                $result = $formatter->formatAutoComment( $summary );
-               $this->assertEquals( $expected, $result, 'Not the expected 
result' );
+               $this->assertSame( $expected, $result, 'Not the expected 
result' );
        }
 
        public function providerFormatAutoComment() {
@@ -210,7 +214,7 @@
 
                $formatter = $this->newFormatter();
                $result = $formatter->formatAutoSummary( $summary );
-               $this->assertEquals( $expected, $result, 'Not the expected 
result' );
+               $this->assertSame( $expected, $result, 'Not the expected 
result' );
        }
 
        public function providerFormatAutoSummary() {
@@ -244,7 +248,7 @@
                $summary->addAutoSummaryArgs( $summaryArgs );
 
                $formatter = $this->newFormatter();
-               $this->assertEquals( $expected, $formatter->formatSummary( 
$summary ) );
+               $this->assertSame( $expected, $formatter->formatSummary( 
$summary ) );
        }
 
        public function provideToStringArgs() {
@@ -324,7 +328,7 @@
                }
 
                $formatter = $this->newFormatter();
-               $this->assertEquals( $expected, $formatter->formatSummary( 
$summary ) );
+               $this->assertSame( $expected, $formatter->formatSummary( 
$summary ) );
        }
 
        public function provideFormatSummary() {
@@ -449,16 +453,20 @@
         */
        public function testOnFormat( $type, $root, $pre, $auto, $post, $title, 
$local, $expected ) {
                $itemTitle = $this->getMock( $title );
-               $itemTitle->expects( $this->once() )->method( 'getNamespace' 
)->will( $this->returnValue(
-                       
WikibaseRepo::getDefaultInstance()->getEntityNamespaceLookup()->getEntityNamespace(
 $type )
-               ) );
+               $itemTitle->expects( $this->once() )
+                       ->method( 'getNamespace' )
+                       ->will( $this->returnValue(
+                               WikibaseRepo::getDefaultInstance()
+                                       ->getEntityNamespaceLookup()
+                                       ->getEntityNamespace( $type )
+                       ) );
 
                $comment = null;
 
                RepoHooks::onFormat( $comment, $pre, $auto, $post, $itemTitle, 
$local );
 
                if ( is_null( $expected ) ) {
-                       $this->assertEquals( $expected, $comment, "Didn't find 
the expected null" );
+                       $this->assertNull( $comment, 'Didn\'t find the expected 
null' );
                } else {
                        $this->assertRegExp( $expected, $comment, "Didn't find 
the expected final comment" );
                }
diff --git a/extensions/Wikibase/view/src/StatementGroupListView.php 
b/extensions/Wikibase/view/src/StatementGroupListView.php
index fbb87a4..4122417 100644
--- a/extensions/Wikibase/view/src/StatementGroupListView.php
+++ b/extensions/Wikibase/view/src/StatementGroupListView.php
@@ -4,6 +4,7 @@
 
 use Wikibase\DataModel\Services\EntityId\EntityIdFormatter;
 use Wikibase\DataModel\Statement\Statement;
+use Wikibase\Lib\Store\PropertyOrderProvider;
 use Wikibase\View\Template\TemplateFactory;
 
 /**
@@ -16,6 +17,11 @@
  * @author Daniel Kinzler
  */
 class StatementGroupListView {
+
+       /**
+        * @var PropertyOrderProvider
+        */
+       private $propertyOrderProvider;
 
        /**
         * @var TemplateFactory
@@ -38,17 +44,20 @@
        private $claimHtmlGenerator;
 
        /**
+        * @param PropertyOrderProvider $propertyOrderProvider,
         * @param TemplateFactory $templateFactory
         * @param EntityIdFormatter $propertyIdFormatter
         * @param EditSectionGenerator $sectionEditLinkGenerator
         * @param ClaimHtmlGenerator $claimHtmlGenerator
         */
        public function __construct(
+               PropertyOrderProvider $propertyOrderProvider,
                TemplateFactory $templateFactory,
                EntityIdFormatter $propertyIdFormatter,
                EditSectionGenerator $sectionEditLinkGenerator,
                ClaimHtmlGenerator $claimHtmlGenerator
        ) {
+               $this->propertyOrderProvider = $propertyOrderProvider;
                $this->propertyIdFormatter = $propertyIdFormatter;
                $this->editSectionGenerator = $sectionEditLinkGenerator;
                $this->claimHtmlGenerator = $claimHtmlGenerator;
@@ -64,7 +73,9 @@
         * @return string HTML
         */
        public function getHtml( array $statements ) {
-               $statementsByProperty = $this->groupStatementsByProperties( 
$statements );
+               $statementsByProperty = $this->orderStatementsByPropertyOrder(
+                       $this->groupStatementsByProperties( $statements )
+               );
 
                $statementsHtml = '';
                foreach ( $statementsByProperty as $statements ) {
@@ -86,11 +97,39 @@
                $byProperty = array();
 
                foreach ( $statements as $statement ) {
-                       $propertyId = 
$statement->getMainSnak()->getPropertyId();
+                       $propertyId = $statement->getPropertyId();
                        $byProperty[$propertyId->getSerialization()][] = 
$statement;
                }
 
                return $byProperty;
+       }
+
+       /**
+        * @param array[] $statementsByProperty The array keys are expected to 
be Property ID
+        *  serializations.
+        *
+        * @return array[]
+        */
+       private function orderStatementsByPropertyOrder( array 
$statementsByProperty ) {
+               $propertyOrder = 
$this->propertyOrderProvider->getPropertyOrder();
+
+               if ( !$propertyOrder ) {
+                       return $statementsByProperty;
+               }
+
+               $ordered = [];
+               $unordered = [];
+
+               foreach ( $statementsByProperty as $propertyId => $statements ) 
{
+                       if ( isset( $propertyOrder[$propertyId] ) ) {
+                               $ordered[$propertyOrder[$propertyId]] = 
$statements;
+                       } else {
+                               $unordered[] = $statements;
+                       }
+               }
+
+               ksort( $ordered );
+               return array_merge( $ordered, $unordered );
        }
 
        /**
@@ -99,7 +138,7 @@
         * @return string HTML
         */
        private function getHtmlForStatementGroupView( array $statements ) {
-               $propertyId = $statements[0]->getMainSnak()->getPropertyId();
+               $propertyId = $statements[0]->getPropertyId();
                $addStatementHtml = 
$this->editSectionGenerator->getAddStatementToGroupSection( $propertyId );
 
                return $this->templateFactory->render(
diff --git a/extensions/Wikibase/view/src/ViewFactory.php 
b/extensions/Wikibase/view/src/ViewFactory.php
index 5927866..472c3a3 100644
--- a/extensions/Wikibase/view/src/ViewFactory.php
+++ b/extensions/Wikibase/view/src/ViewFactory.php
@@ -11,6 +11,7 @@
 use Wikibase\LanguageFallbackChain;
 use Wikibase\Lib\LanguageNameLookup;
 use Wikibase\Lib\SnakFormatter;
+use Wikibase\Lib\Store\PropertyOrderProvider;
 use Wikibase\View\Template\TemplateFactory;
 
 /**
@@ -45,6 +46,11 @@
         * @var StatementGrouper
         */
        private $statementGrouper;
+
+       /**
+        * @var PropertyOrderProvider
+        */
+       private $propertyOrderProvider;
 
        /**
         * @var SiteStore
@@ -101,6 +107,7 @@
         * @param EntityIdFormatterFactory $plainTextIdFormatterFactory
         * @param HtmlSnakFormatterFactory $htmlSnakFormatterFactory
         * @param StatementGrouper $statementGrouper
+        * @param PropertyOrderProvider $propertyOrderProvider,
         * @param SiteStore $siteStore
         * @param DataTypeFactory $dataTypeFactory
         * @param TemplateFactory $templateFactory
@@ -119,6 +126,7 @@
                EntityIdFormatterFactory $plainTextIdFormatterFactory,
                HtmlSnakFormatterFactory $htmlSnakFormatterFactory,
                StatementGrouper $statementGrouper,
+               PropertyOrderProvider $propertyOrderProvider,
                SiteStore $siteStore,
                DataTypeFactory $dataTypeFactory,
                TemplateFactory $templateFactory,
@@ -140,6 +148,7 @@
                $this->plainTextIdFormatterFactory = 
$plainTextIdFormatterFactory;
                $this->htmlSnakFormatterFactory = $htmlSnakFormatterFactory;
                $this->statementGrouper = $statementGrouper;
+               $this->propertyOrderProvider = $propertyOrderProvider;
                $this->siteStore = $siteStore;
                $this->dataTypeFactory = $dataTypeFactory;
                $this->templateFactory = $templateFactory;
@@ -292,6 +301,7 @@
                        $this->textProvider
                );
                $statementGroupListView = new StatementGroupListView(
+                       $this->propertyOrderProvider,
                        $this->templateFactory,
                        $propertyIdFormatter,
                        $editSectionGenerator,
diff --git 
a/extensions/Wikibase/view/tests/phpunit/StatementGroupListViewTest.php 
b/extensions/Wikibase/view/tests/phpunit/StatementGroupListViewTest.php
index 90b0a43..75d693b 100644
--- a/extensions/Wikibase/view/tests/phpunit/StatementGroupListViewTest.php
+++ b/extensions/Wikibase/view/tests/phpunit/StatementGroupListViewTest.php
@@ -13,6 +13,7 @@
 use Wikibase\DataModel\Snak\PropertyValueSnak;
 use Wikibase\DataModel\Snak\Snak;
 use Wikibase\DataModel\Statement\Statement;
+use Wikibase\Lib\Store\PropertyOrderProvider;
 use Wikibase\View\ClaimHtmlGenerator;
 use Wikibase\View\EditSectionGenerator;
 use Wikibase\View\StatementGroupListView;
@@ -39,9 +40,7 @@
                $propertyId = new PropertyId( 'P77' );
                $statements = $this->makeStatements( $propertyId );
 
-               $propertyIdFormatter = $this->getEntityIdFormatter();
-
-               $statementGroupListView = $this->newStatementGroupListView( 
$propertyIdFormatter );
+               $statementGroupListView = $this->newStatementGroupListView();
 
                $html = $statementGroupListView->getHtml( $statements );
 
@@ -51,6 +50,36 @@
                        $this->assertContains( $statement->getGuid(), $html );
                }
                $this->assertContains( '<TOOLBAR></TOOLBAR>', $html );
+       }
+
+       public function testPropertyOrdering() {
+               $statements = [
+                       $this->makeNoValueStatement( 'P2' ),
+                       $this->makeNoValueStatement( 'P103' ),
+                       $this->makeNoValueStatement( 'P1' ),
+                       $this->makeNoValueStatement( 'P101' ),
+                       $this->makeNoValueStatement( 'P102' ),
+               ];
+               $view = $this->newStatementGroupListView();
+               $html = $view->getHtml( $statements );
+               $this->assertRegExp( '/^[^$]*\$' . implode( '\n[^$]*\$', [
+                       'P101',
+                       'P102',
+                       'P103',
+                       'P2',
+                       'P1',
+               ] ) . '\n[^$]*$/s', $html );
+       }
+
+       /**
+        * @param string $propertyId
+        *
+        * @return Statement
+        */
+       private function makeNoValueStatement( $propertyId ) {
+               $statement = new Statement( new PropertyNoValueSnak( new 
PropertyId( $propertyId ) ) );
+               $statement->setGuid( 'GUID$' . $propertyId );
+               return $statement;
        }
 
        /**
@@ -102,11 +131,9 @@
        }
 
        /**
-        * @param EntityIdFormatter $propertyIdFormatter
-        *
         * @return StatementGroupListView
         */
-       private function newStatementGroupListView( EntityIdFormatter 
$propertyIdFormatter ) {
+       private function newStatementGroupListView() {
                $templateFactory = new TemplateFactory( new TemplateRegistry( 
array(
                        'wikibase-statementgrouplistview' => 
'<SGLIST>$1</SGLIST>',
                        'wikibase-listview' => '<LIST>$1</LIST>',
@@ -115,11 +142,29 @@
                ) ) );
 
                return new StatementGroupListView(
+                       $this->getPropertyOrderProvider(),
                        $templateFactory,
-                       $propertyIdFormatter,
+                       $this->getEntityIdFormatter(),
                        $this->getMock( EditSectionGenerator::class ),
                        $this->getClaimHtmlGenerator()
                );
+       }
+
+       /**
+        * @return PropertyOrderProvider
+        */
+       private function getPropertyOrderProvider() {
+               $propertyOrderProvider = $this->getMock( 
PropertyOrderProvider::class );
+
+               $propertyOrderProvider->expects( $this->any() )
+                       ->method( 'getPropertyOrder' )
+                       ->will( $this->returnValue( [
+                               'P101' => 0,
+                               'P102' => 1,
+                               'P103' => 2,
+                       ] ) );
+
+               return $propertyOrderProvider;
        }
 
        /**
@@ -143,13 +188,13 @@
         * @return EntityIdFormatter
         */
        private function getEntityIdFormatter() {
-               $lookup = $this->getMock( EntityIdFormatter::class );
+               $entityIdFormatter = $this->getMock( EntityIdFormatter::class );
 
-               $lookup->expects( $this->once() )
+               $entityIdFormatter->expects( $this->any() )
                        ->method( 'formatEntityId' )
                        ->will( $this->returnValue( '<ID>' ) );
 
-               return $lookup;
+               return $entityIdFormatter;
        }
 
 }
diff --git a/extensions/Wikibase/view/tests/phpunit/ViewFactoryTest.php 
b/extensions/Wikibase/view/tests/phpunit/ViewFactoryTest.php
index 1218280..c8727cf 100644
--- a/extensions/Wikibase/view/tests/phpunit/ViewFactoryTest.php
+++ b/extensions/Wikibase/view/tests/phpunit/ViewFactoryTest.php
@@ -13,6 +13,7 @@
 use Wikibase\LanguageFallbackChain;
 use Wikibase\Lib\LanguageNameLookup;
 use Wikibase\Lib\SnakFormatter;
+use Wikibase\Lib\Store\PropertyOrderProvider;
 use Wikibase\View\EditSectionGenerator;
 use Wikibase\View\EntityTermsView;
 use Wikibase\View\HtmlSnakFormatterFactory;
@@ -68,6 +69,7 @@
                        $plainFactory ?: $this->getEntityIdFormatterFactory( 
SnakFormatter::FORMAT_PLAIN ),
                        $this->getSnakFormatterFactory(),
                        new NullStatementGrouper(),
+                       $this->getMock( PropertyOrderProvider::class ),
                        new HashSiteStore(),
                        new DataTypeFactory( array() ),
                        $templateFactory,
diff --git a/vendor/composer/autoload_classmap.php 
b/vendor/composer/autoload_classmap.php
index 37057e2..8f7ad51 100644
--- a/vendor/composer/autoload_classmap.php
+++ b/vendor/composer/autoload_classmap.php
@@ -884,7 +884,6 @@
     'Wikibase\\Lib\\Store\\EntityTermLookupBase' => $baseDir . 
'/extensions/Wikibase/lib/includes/Store/EntityTermLookupBase.php',
     'Wikibase\\Lib\\Store\\EntityTitleLookup' => $baseDir . 
'/extensions/Wikibase/lib/includes/Store/EntityTitleLookup.php',
     'Wikibase\\Lib\\Store\\FallbackPropertyOrderProvider' => $baseDir . 
'/extensions/Wikibase/lib/includes/Store/FallbackPropertyOrderProvider.php',
-    'Wikibase\\Lib\\Store\\ForeignEntityRevisionLookupFactory' => $baseDir . 
'/extensions/Wikibase/lib/includes/Store/ForeignEntityRevisionLookupFactory.php',
     'Wikibase\\Lib\\Store\\GenericEntityInfoBuilder' => $baseDir . 
'/extensions/Wikibase/lib/includes/Store/GenericEntityInfoBuilder.php',
     'Wikibase\\Lib\\Store\\HashSiteLinkStore' => $baseDir . 
'/extensions/Wikibase/lib/includes/Store/HashSiteLinkStore.php',
     'Wikibase\\Lib\\Store\\HttpUrlPropertyOrderProvider' => $baseDir . 
'/extensions/Wikibase/lib/includes/Store/HttpUrlPropertyOrderProvider.php',
@@ -894,6 +893,7 @@
     'Wikibase\\Lib\\Store\\PropertyInfoLookup' => $baseDir . 
'/extensions/Wikibase/lib/includes/Store/PropertyInfoLookup.php',
     'Wikibase\\Lib\\Store\\PropertyOrderProvider' => $baseDir . 
'/extensions/Wikibase/lib/includes/Store/PropertyOrderProvider.php',
     'Wikibase\\Lib\\Store\\PropertyOrderProviderException' => $baseDir . 
'/extensions/Wikibase/lib/includes/Store/PropertyOrderProviderException.php',
+    'Wikibase\\Lib\\Store\\RepositorySpecificEntityRevisionLookupFactory' => 
$baseDir . 
'/extensions/Wikibase/lib/includes/Store/RepositorySpecificEntityRevisionLookupFactory.php',
     'Wikibase\\Lib\\Store\\RevisionBasedEntityLookup' => $baseDir . 
'/extensions/Wikibase/lib/includes/Store/RevisionBasedEntityLookup.php',
     'Wikibase\\Lib\\Store\\RevisionedUnresolvedRedirectException' => $baseDir 
. 
'/extensions/Wikibase/lib/includes/Store/RevisionedUnresolvedRedirectException.php',
     'Wikibase\\Lib\\Store\\SiteLinkLookup' => $baseDir . 
'/extensions/Wikibase/lib/includes/Store/SiteLinkLookup.php',
@@ -1003,7 +1003,6 @@
     'Wikibase\\Lib\\Tests\\Store\\EntityTermLookupTest' => $baseDir . 
'/extensions/Wikibase/lib/tests/phpunit/Store/EntityTermLookupTest.php',
     'Wikibase\\Lib\\Tests\\Store\\FallbackPropertyOrderProviderTest' => 
$baseDir . 
'/extensions/Wikibase/lib/tests/phpunit/Store/FallbackPropertyOrderProviderTest.php',
     'Wikibase\\Lib\\Tests\\Store\\FieldPropertyInfoProviderTest' => $baseDir . 
'/extensions/Wikibase/lib/tests/phpunit/Store/FieldPropertyInfoProviderTest.php',
-    'Wikibase\\Lib\\Tests\\Store\\ForeignEntityRevisionLookupFactoryTest' => 
$baseDir . 
'/extensions/Wikibase/lib/tests/phpunit/Store/ForeignEntityRevisionLookupFactoryTest.php',
     'Wikibase\\Lib\\Tests\\Store\\GenericEntityInfoBuilderTest' => $baseDir . 
'/extensions/Wikibase/lib/tests/phpunit/Store/GenericEntityInfoBuilderTest.php',
     'Wikibase\\Lib\\Tests\\Store\\HashSiteLinkStoreTest' => $baseDir . 
'/extensions/Wikibase/lib/tests/phpunit/Store/HashSiteLinkStoreTest.php',
     'Wikibase\\Lib\\Tests\\Store\\HttpUrlPropertyOrderProviderTest' => 
$baseDir . 
'/extensions/Wikibase/lib/tests/phpunit/Store/HttpUrlPropertyOrderProviderTest.php',
@@ -1017,6 +1016,7 @@
     
'Wikibase\\Lib\\Tests\\Store\\PrefetchingWikiPageEntityMetaDataAccessorTest' => 
$baseDir . 
'/extensions/Wikibase/lib/tests/phpunit/Store/PrefetchingWikiPageEntityMetaDataAccessorTest.php',
     'Wikibase\\Lib\\Tests\\Store\\PropertyInfoStoreTestHelper' => $baseDir . 
'/extensions/Wikibase/lib/tests/phpunit/Store/PropertyInfoStoreTestHelper.php',
     'Wikibase\\Lib\\Tests\\Store\\RedirectRevisionTest' => $baseDir . 
'/extensions/Wikibase/lib/tests/phpunit/Store/RedirectRevisionTest.php',
+    
'Wikibase\\Lib\\Tests\\Store\\RepositorySpecificEntityRevisionLookupFactoryTest'
 => $baseDir . 
'/extensions/Wikibase/lib/tests/phpunit/Store/RepositorySpecificEntityRevisionLookupFactoryTest.php',
     'Wikibase\\Lib\\Tests\\Store\\RevisionBasedEntityLookupTest' => $baseDir . 
'/extensions/Wikibase/lib/tests/phpunit/Store/RevisionBasedEntityLookupTest.php',
     'Wikibase\\Lib\\Tests\\Store\\Sql\\EntityChangeLookupTest' => $baseDir . 
'/extensions/Wikibase/lib/tests/phpunit/Store/Sql/EntityChangeLookupTest.php',
     'Wikibase\\Lib\\Tests\\Store\\Sql\\PropertyInfoTableTest' => $baseDir . 
'/extensions/Wikibase/lib/tests/phpunit/Store/Sql/PropertyInfoTableTest.php',
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index ec531e5..5949051 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -115,19 +115,19 @@
         "source": {
             "type": "git",
             "url": 
"https://github.com/wikimedia/mediawiki-extensions-ArticlePlaceholder.git";,
-            "reference": "073655e60027306b3e49651ad2b33d9104a02f23"
+            "reference": "f46f7485ab6be0390b53cf6c6f5dcd6db8b73da2"
         },
         "dist": {
             "type": "zip",
-            "url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-ArticlePlaceholder/zipball/073655e60027306b3e49651ad2b33d9104a02f23";,
-            "reference": "073655e60027306b3e49651ad2b33d9104a02f23",
+            "url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-ArticlePlaceholder/zipball/f46f7485ab6be0390b53cf6c6f5dcd6db8b73da2";,
+            "reference": "f46f7485ab6be0390b53cf6c6f5dcd6db8b73da2",
             "shasum": ""
         },
         "require-dev": {
             "jakub-onderka/php-parallel-lint": "0.9.2",
             "mediawiki/mediawiki-codesniffer": "0.7.2"
         },
-        "time": "2016-12-12 21:18:26",
+        "time": "2016-12-13 21:39:24",
         "type": "mediawiki-extension",
         "installation-source": "dist",
         "autoload": {
@@ -1406,12 +1406,12 @@
         "source": {
             "type": "git",
             "url": 
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git";,
-            "reference": "814270bb953c92360b0c4c2bdb52b96764ad0078"
+            "reference": "2bd1411ceb2bc0c2000ad1417dc0ef8bf8af78a1"
         },
         "dist": {
             "type": "zip",
-            "url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/814270bb953c92360b0c4c2bdb52b96764ad0078";,
-            "reference": "814270bb953c92360b0c4c2bdb52b96764ad0078",
+            "url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/2bd1411ceb2bc0c2000ad1417dc0ef8bf8af78a1";,
+            "reference": "2bd1411ceb2bc0c2000ad1417dc0ef8bf8af78a1",
             "shasum": ""
         },
         "require": {
@@ -1444,7 +1444,7 @@
             "jakub-onderka/php-parallel-lint": "0.9.2",
             "mediawiki/mediawiki-codesniffer": "0.4.0|0.5.0"
         },
-        "time": "2016-12-12 21:44:23",
+        "time": "2016-12-13 21:47:00",
         "type": "mediawiki-extension",
         "installation-source": "dist",
         "autoload": {

-- 
To view, visit https://gerrit.wikimedia.org/r/327160
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic6bbc2aa0521231769c55ba659169fc727606509
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikidata
Gerrit-Branch: master
Gerrit-Owner: WikidataBuilder <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to