Addshore has uploaded a new change for review.

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


Change subject: Add test cases for By PropertyList lowercase keys
......................................................................

Add test cases for By PropertyList lowercase keys

Change-Id: I8c7aaba885c139c168064cbd5a756e57882e286f
---
M lib/tests/phpunit/serializers/ByPropertyListUnserializerTest.php
1 file changed, 53 insertions(+), 0 deletions(-)


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

diff --git a/lib/tests/phpunit/serializers/ByPropertyListUnserializerTest.php 
b/lib/tests/phpunit/serializers/ByPropertyListUnserializerTest.php
index bcda114..fcfe2d0 100644
--- a/lib/tests/phpunit/serializers/ByPropertyListUnserializerTest.php
+++ b/lib/tests/phpunit/serializers/ByPropertyListUnserializerTest.php
@@ -59,11 +59,13 @@
                $snak1 = new PropertySomeValueSnak( $id2 );
                $snak2 = new PropertyValueSnak( $id2, $dataValue0 );
 
+               //0 empty serialization 1
                $validArgs[] = array(
                        array(),
                        array(),
                );
 
+               //1 empty serialization 2
                $validArgs[] = array(
                        array(
                                'P42' => array(
@@ -74,6 +76,7 @@
                        array(),
                );
 
+               //2 Snaks by property (uppercase)
                $validArgs[] = array(
                        array(
                                'P42' => array(
@@ -97,6 +100,56 @@
                        array( $snak0, $snak1, $snak2 ),
                );
 
+               //2 Snaks by property (lowercase)
+               $validArgs[] = array(
+                       array(
+                               'p42' => array(
+                                       0 => array(
+                                               'snaktype' => 'novalue',
+                                               'property' => 'p42',
+                                       ),
+                               ),
+                               'p2' => array(
+                                       0 => array(
+                                               'snaktype' => 'somevalue',
+                                               'property' => 'p2',
+                                       ),
+                                       1 => array(
+                                               'snaktype' => 'value',
+                                               'property' => 'p2',
+                                               'datavalue' => 
$dataValue0->toArray(),
+                                       ),
+                               ),
+                       ),
+                       array( $snak0, $snak1, $snak2 ),
+               );
+
+               //2 Snaks by property (upper and lower case)
+               $validArgs[] = array(
+                       array(
+                               'P42' => array(
+                                       0 => array(
+                                               'snaktype' => 'novalue',
+                                               'property' => 'P42',
+                                       ),
+                               ),
+                               'P2' => array(
+                                       0 => array(
+                                               'snaktype' => 'somevalue',
+                                               'property' => 'P2',
+                                       ),
+                               ),
+                               'p2' => array(
+                                       0 => array(
+                                               'snaktype' => 'value',
+                                               'property' => 'p2',
+                                               'datavalue' => 
$dataValue0->toArray(),
+                                       ),
+                               ),
+                       ),
+                       array( $snak0, $snak1, $snak2 ),
+               );
+
                return $validArgs;
        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8c7aaba885c139c168064cbd5a756e57882e286f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>

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

Reply via email to