jenkins-bot has submitted this change and it was merged.

Change subject: Fix aspect assert in SpecialEntityUsageTest
......................................................................


Fix aspect assert in SpecialEntityUsageTest

This fails on travis, see for example:
https://travis-ci.org/wikimedia/mediawiki-extensions-Wikibase/jobs/167356525

Change-Id: Ib9cd4779d625cd4076a4404f3346a8b9cd41c50f
---
M client/tests/phpunit/includes/Specials/SpecialEntityUsageTest.php
1 file changed, 14 insertions(+), 3 deletions(-)

Approvals:
  Ladsgroup: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/client/tests/phpunit/includes/Specials/SpecialEntityUsageTest.php 
b/client/tests/phpunit/includes/Specials/SpecialEntityUsageTest.php
index df6093e..794289e 100644
--- a/client/tests/phpunit/includes/Specials/SpecialEntityUsageTest.php
+++ b/client/tests/phpunit/includes/Specials/SpecialEntityUsageTest.php
@@ -106,25 +106,36 @@
                $special->prepareParams( 'Q3' );
                $res = $special->reallyDoQuery( 50 );
                $values = [];
+               $expectedUsages = [
+                       [ 'L.de' ],
+                       [ 'S', 'O' ],
+               ];
 
+               $i = 0;
                foreach ( $res as $row ) {
                        $values[] = [
                                $row->value,
                                $row->namespace,
                                $row->title,
-                               $row->aspects,
                                $row->eu_page_id
                        ];
+
+                       $this->assertUsageAspects( $expectedUsages[$i++], 
$row->aspects );
                }
 
                $expected = [
-                       [ '22', '0', 'Berlin', 'L.de', '22' ],
-                       [ '11', '0', 'Vienna', 'O|S', '11' ],
+                       [ '22', '0', 'Berlin', '22' ],
+                       [ '11', '0', 'Vienna', '11' ],
                ];
 
                $this->assertSame( $expected, $values );
        }
 
+       private function assertUsageAspects( $expected, $aspectsString ) {
+               // The aspects are not ordered, so don't take this into account 
when asserting
+               $this->assertArrayEquals( $expected, explode( '|', 
$aspectsString ), false );
+       }
+
        private function addReallyDoQueryData() {
                $db = wfGetDB( DB_MASTER );
                $dump = [

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib9cd4779d625cd4076a4404f3346a8b9cd41c50f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man <h...@online.de>
Gerrit-Reviewer: Addshore <addshorew...@gmail.com>
Gerrit-Reviewer: Aude <aude.w...@gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com>
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