Jeroen De Dauw has submitted this change and it was merged.

Change subject: Make PropertyContentTest work with DataModel 1.0
......................................................................


Make PropertyContentTest work with DataModel 1.0

In DataModel 1.0 Properties do not contain claims any more so we have to
move all claim related stuff into the ItemHandlerTest.

Change-Id: Ib3d761912e5721e63d14e4565c8a272ab4164f50
---
M repo/tests/phpunit/includes/content/EntityContentTest.php
M repo/tests/phpunit/includes/content/ItemContentTest.php
2 files changed, 31 insertions(+), 21 deletions(-)

Approvals:
  WikidataJenkins: Verified
  Jeroen De Dauw: Looks good to me, approved



diff --git a/repo/tests/phpunit/includes/content/EntityContentTest.php 
b/repo/tests/phpunit/includes/content/EntityContentTest.php
index e175c59..90ed889 100644
--- a/repo/tests/phpunit/includes/content/EntityContentTest.php
+++ b/repo/tests/phpunit/includes/content/EntityContentTest.php
@@ -167,16 +167,6 @@
                        array( 'wb-status' => EntityContent::STATUS_STUB, 
'wb-claims' => 0 )
                );
 
-               $contentWithClaim = $this->newEmpty();
-               $claim = new Statement( new PropertyNoValueSnak( 83 ) );
-               $claim->setGuid( '$testing$' );
-               $contentWithClaim->getEntity()->addClaim( $claim );
-
-               $cases['claims'] = array(
-                       $contentWithClaim,
-                       array( 'wb-claims' => 1 )
-               );
-
                return $cases;
        }
 
@@ -197,11 +187,6 @@
                $contentWithLabel = $this->newEmpty();
                $contentWithLabel->getEntity()->setLabel( 'de', 'xyz' );
 
-               $contentWithClaim = $this->newEmpty();
-               $claim = new Statement( new PropertyNoValueSnak( 83 ) );
-               $claim->setGuid( '$testing$' );
-               $contentWithClaim->getEntity()->addClaim( $claim );
-
                return array(
                        'empty' => array(
                                $this->newEmpty(),
@@ -210,10 +195,6 @@
                        'labels' => array(
                                $contentWithLabel,
                                EntityContent::STATUS_STUB
-                       ),
-                       'claims' => array(
-                               $contentWithClaim,
-                               EntityContent::STATUS_NONE
                        ),
                );
        }
diff --git a/repo/tests/phpunit/includes/content/ItemContentTest.php 
b/repo/tests/phpunit/includes/content/ItemContentTest.php
index a980d4a..7d3e07e 100644
--- a/repo/tests/phpunit/includes/content/ItemContentTest.php
+++ b/repo/tests/phpunit/includes/content/ItemContentTest.php
@@ -94,6 +94,18 @@
                        array( 'wb-claims' => 0, 'wb-sitelinks' => 1 )
                );
 
+               // @todo this is needed in PropertyContentTest as well
+               //       once we have statements in properties
+               $contentWithClaim = $this->newEmpty();
+               $claim = new Statement( new PropertyNoValueSnak( 83 ) );
+               $claim->setGuid( '$testing$' );
+               $contentWithClaim->getEntity()->addClaim( $claim );
+
+               $cases['claims'] = array(
+                       $contentWithClaim,
+                       array( 'wb-claims' => 1 )
+               );
+
                return $cases;
        }
 
@@ -116,8 +128,25 @@
                        ItemContent::STATUS_LINKSTUB
                );
 
-               $cases['statements and links'] = $cases['claims']; // from 
parent::provideGetEntityStatus();
-               $cases['statements and 
links'][0]->getEntity()->getSiteLinkList()->addNewSiteLink( 'enwiki', 'Foo' );
+               // @todo this is needed in PropertyContentTest as well
+               //       once we have statements in properties
+               $contentWithClaim = $this->newEmpty();
+               $claim = new Statement( new PropertyNoValueSnak( 83 ) );
+               $claim->setGuid( '$testing$' );
+               $contentWithClaim->getEntity()->addClaim( $claim );
+               
+               $cases['claims'] = array(
+                       $contentWithClaim,
+                       EntityContent::STATUS_NONE
+               );
+
+               $contentWithClaimAndLink = $contentWithClaim->copy();
+               
$contentWithClaimAndLink->getEntity()->getSiteLinkList()->addNewSiteLink( 
'enwiki', 'Foo' );
+
+               $cases['statements and links'] = array(
+                       $contentWithClaimAndLink,
+                       EntityContent::STATUS_NONE
+               );
 
                return $cases;
        }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib3d761912e5721e63d14e4565c8a272ab4164f50
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Bene <benestar.wikime...@gmail.com>
Gerrit-Reviewer: Addshore <addshorew...@gmail.com>
Gerrit-Reviewer: Aude <aude.w...@gmail.com>
Gerrit-Reviewer: Hoo man <h...@online.de>
Gerrit-Reviewer: Jeroen De Dauw <jeroended...@gmail.com>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.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

Reply via email to