@@ -241,6 +241,9 @@ public function testClearRemovesAllButId() {
241241
242242 $ this ->assertEquals ( new ItemId ( 'Q42 ' ), $ item ->getId () );
243243 $ this ->assertTrue ( $ item ->getFingerprint ()->isEmpty () );
244+ $ this ->assertTrue ( $ item ->getLabels ()->isEmpty () );
245+ $ this ->assertTrue ( $ item ->getDescriptions ()->isEmpty () );
246+ $ this ->assertTrue ( $ item ->getAliasGroups ()->isEmpty () );
244247 $ this ->assertTrue ( $ item ->getSiteLinkList ()->isEmpty () );
245248 $ this ->assertTrue ( $ item ->getStatements ()->isEmpty () );
246249 }
@@ -250,6 +253,9 @@ public function testEmptyConstructor() {
250253
251254 $ this ->assertNull ( $ item ->getId () );
252255 $ this ->assertTrue ( $ item ->getFingerprint ()->isEmpty () );
256+ $ this ->assertTrue ( $ item ->getLabels ()->isEmpty () );
257+ $ this ->assertTrue ( $ item ->getDescriptions ()->isEmpty () );
258+ $ this ->assertTrue ( $ item ->getAliasGroups ()->isEmpty () );
253259 $ this ->assertTrue ( $ item ->getSiteLinkList ()->isEmpty () );
254260 $ this ->assertTrue ( $ item ->getStatements ()->isEmpty () );
255261 }
@@ -720,4 +726,67 @@ public function testWhenSettingFingerprint_getFingerprintReturnsIt() {
720726 $ this ->assertSame ( $ fingerprint , $ newFingerprint );
721727 }
722728
729+ public function testGetLabels () {
730+ $ item = new Item ();
731+ $ item ->setLabel ( 'en ' , 'foo ' );
732+
733+ $ this ->assertEquals (
734+ new TermList ( array (
735+ new Term ( 'en ' , 'foo ' )
736+ ) ),
737+ $ item ->getLabels ()
738+ );
739+ }
740+
741+ public function testGetDescriptions () {
742+ $ item = new Item ();
743+ $ item ->setDescription ( 'en ' , 'foo bar ' );
744+
745+ $ this ->assertEquals (
746+ new TermList ( array (
747+ new Term ( 'en ' , 'foo bar ' )
748+ ) ),
749+ $ item ->getDescriptions ()
750+ );
751+ }
752+
753+ public function testGetAliasGroups () {
754+ $ item = new Item ();
755+ $ item ->setAliases ( 'en ' , array ( 'foo ' , 'bar ' ) );
756+
757+ $ this ->assertEquals (
758+ new AliasGroupList ( array (
759+ new AliasGroup ( 'en ' , array ( 'foo ' , 'bar ' ) )
760+ ) ),
761+ $ item ->getAliasGroups ()
762+ );
763+ }
764+
765+ public function testGetLabels_sameListAsFingerprint () {
766+ $ item = new Item ();
767+
768+ $ this ->assertSame (
769+ $ item ->getFingerprint ()->getLabels (),
770+ $ item ->getLabels ()
771+ );
772+ }
773+
774+ public function testGetDescriptions_sameListAsFingerprint () {
775+ $ item = new Item ();
776+
777+ $ this ->assertSame (
778+ $ item ->getFingerprint ()->getDescriptions (),
779+ $ item ->getDescriptions ()
780+ );
781+ }
782+
783+ public function testGetAliasGroups_sameListAsFingerprint () {
784+ $ item = new Item ();
785+
786+ $ this ->assertSame (
787+ $ item ->getFingerprint ()->getAliasGroups (),
788+ $ item ->getAliasGroups ()
789+ );
790+ }
791+
723792}
0 commit comments