Hoo man has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/317354

Change subject: Also test data access output of linked wikibase-item Snaks
......................................................................

Also test data access output of linked wikibase-item Snaks

Making use of EntityIdSiteLinkFormatter.

Change-Id: Ia9e69654fc050be4ea3306a06c8e806deb2ae69d
---
M 
client/tests/phpunit/includes/DataAccess/DataAccessSnakFormatterOutputFormatTest.php
1 file changed, 24 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/54/317354/1

diff --git 
a/client/tests/phpunit/includes/DataAccess/DataAccessSnakFormatterOutputFormatTest.php
 
b/client/tests/phpunit/includes/DataAccess/DataAccessSnakFormatterOutputFormatTest.php
index a312b10..c02a736 100644
--- 
a/client/tests/phpunit/includes/DataAccess/DataAccessSnakFormatterOutputFormatTest.php
+++ 
b/client/tests/phpunit/includes/DataAccess/DataAccessSnakFormatterOutputFormatTest.php
@@ -52,10 +52,11 @@
                        new EntityRetrievingTermLookup( 
$store->getEntityLookup() )
                );
 
-               $this->setUpDummyData( $store );
+               $siteId = $wikibaseClient->getSettings()->getSetting( 
'siteGlobalID' );
+               $this->setUpDummyData( $store, $siteId );
        }
 
-       private function setUpDummyData( MockClientStore $store ) {
+       private function setUpDummyData( MockClientStore $store, $siteId ) {
                $mockRepository = $store->getEntityRevisionLookup();
                $dataTypeIds = [
                        'P1' => 'commonsMedia',
@@ -91,6 +92,12 @@
 
                $item = new Item( new ItemId( 'Q12' ) );
                $item->setLabel( 'en', 'label [[with]] wikitext' );
+
+               $mockRepository->putEntity( $item );
+
+               $item = new Item( new ItemId( 'Q13' ) );
+               $item->setLabel( 'en', 'This item has a sitelink' );
+               $item->getSiteLinkList()->addNewSiteLink( $siteId, 'Linked 
page' );
 
                $mockRepository->putEntity( $item );
        }
@@ -135,7 +142,21 @@
                                        new PropertyId( 'P10' ),
                                        new StringValue( 'a b c' )
                                )
-                       ]
+                       ],
+                       'wikibase-item label (wikibase-entityid)' => [
+                               '<span>' . wfEscapeWikiText( 'label [[with]] 
wikitext' ) . '</span>',
+                               new PropertyValueSnak(
+                                       new PropertyId( 'P9' ),
+                                       new EntityIdValue( new ItemId( 'Q12' ) )
+                               )
+                       ],
+                       'wikibase-item link (wikibase-entityid)' => [
+                               '<span>[[Linked page|This item has a 
sitelink]]</span>',
+                               new PropertyValueSnak(
+                                       new PropertyId( 'P9' ),
+                                       new EntityIdValue( new ItemId( 'Q13' ) )
+                               )
+                       ],
                ];
        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9e69654fc050be4ea3306a06c8e806deb2ae69d
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

Reply via email to