jenkins-bot has submitted this change and it was merged.
Change subject: Add more DataValues to DataModelSerializationRoundtripTest
..
Add more DataValues to DataModelSerializationRoundtripTest
At least the most basic DataValue implementations should be tested.
Somebody said all DataValue classes have their own serialization
tests so it is not necesarry to test them all again.
Bug: 66839
Change-Id: I213669827111ec3e743d30a98f152f5273cfd398
---
M lib/tests/phpunit/serializers/DataModelSerializationRoundtripTest.php
1 file changed, 20 insertions(+), 0 deletions(-)
Approvals:
WikidataJenkins: Verified
Daniel Kinzler: Looks good to me, approved
jenkins-bot: Verified
diff --git
a/lib/tests/phpunit/serializers/DataModelSerializationRoundtripTest.php
b/lib/tests/phpunit/serializers/DataModelSerializationRoundtripTest.php
index faa0142..6af6e5d 100644
--- a/lib/tests/phpunit/serializers/DataModelSerializationRoundtripTest.php
+++ b/lib/tests/phpunit/serializers/DataModelSerializationRoundtripTest.php
@@ -2,9 +2,12 @@
namespace Tests\Wikibase\DataModel;
+use DataValues\BooleanValue;
use DataValues\Deserializers\DataValueDeserializer;
use DataValues\Serializers\DataValueSerializer;
use DataValues\StringValue;
+use DataValues\UnDeserializableValue;
+use DataValues\UnknownValue;
use Wikibase\DataModel\Claim\Claim;
use Wikibase\DataModel\Entity\BasicEntityIdParser;
use Wikibase\DataModel\Entity\Entity;
@@ -20,6 +23,9 @@
use Wikibase\Lib\Serializers\SerializationOptions;
/**
+ * @todo Add test for qualifiers.
+ * @todo Add test for references.
+ * @todo Add test for ranks.
* @todo Add tests with $options-setIndexTags( true ).
*
* @licence GNU GPL v2+
@@ -161,13 +167,27 @@
$this-addClaim( $item, new PropertyNoValueSnak(
new PropertyId( 'P401' )
) );
+
$this-addClaim( $item, new PropertySomeValueSnak(
new PropertyId( 'P402' )
) );
+
$this-addClaim( $item, new PropertyValueSnak(
new PropertyId( 'P403' ),
+ new BooleanValue( true )
+ ) );
+ $this-addClaim( $item, new PropertyValueSnak(
+ new PropertyId( 'P404' ),
new StringValue( 'stringvalue' )
) );
+ $this-addClaim( $item, new PropertyValueSnak(
+ new PropertyId( 'P405' ),
+ new UnDeserializableValue( 'undeserializable-data',
'string', 'undeserializable-error' )
+ ) );
+ $this-addClaim( $item, new PropertyValueSnak(
+ new PropertyId( 'P406' ),
+ new UnknownValue( 'unknown-value' )
+ ) );
}
private function addClaim( Item $item, Snak $mainSnak ) {
--
To view, visit https://gerrit.wikimedia.org/r/149000
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I213669827111ec3e743d30a98f152f5273cfd398
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de
Gerrit-Reviewer: Aude aude.w...@gmail.com
Gerrit-Reviewer: Daniel Kinzler daniel.kinz...@wikimedia.de
Gerrit-Reviewer: Hoo man h...@online.de
Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com
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