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

Change subject: Fix EditEntityTest type hinting
......................................................................


Fix EditEntityTest type hinting

Change-Id: Ib4c5387f2fa58cd787d376d95d588a7593e9da8c
---
M repo/tests/phpunit/includes/EditEntityTest.php
1 file changed, 10 insertions(+), 7 deletions(-)

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



diff --git a/repo/tests/phpunit/includes/EditEntityTest.php 
b/repo/tests/phpunit/includes/EditEntityTest.php
index 2fea202..bddd1db 100644
--- a/repo/tests/phpunit/includes/EditEntityTest.php
+++ b/repo/tests/phpunit/includes/EditEntityTest.php
@@ -292,37 +292,38 @@
 
                $entityId = new ItemId( 'Q17' );
                $revision = $repo->getEntityRevision( $entityId, 
$baseRevisionId );
-               $entity = $revision->getEntity();
+               /** @var Item $item */
+               $item = $revision->getEntity();
 
                // NOTE: The user name must be the one used in 
getMockRepository().
                $user = $this->getUser( 'EditEntityTestUser1' );
 
                // change entity ----------------------------------
                if ( $inputData === null ) {
-                       $entity->clear();
+                       $item->clear();
                } else {
                        if ( !empty( $inputData['label'] ) ) {
                                foreach ( $inputData['label'] as $k => $v ) {
-                                       $entity->setLabel( $k, $v );
+                                       $item->setLabel( $k, $v );
                                }
                        }
 
                        if ( !empty( $inputData['description'] ) ) {
                                foreach ( $inputData['description'] as $k => $v 
) {
-                                       $entity->setDescription( $k, $v );
+                                       $item->setDescription( $k, $v );
                                }
                        }
 
                        if ( !empty( $inputData['aliases'] ) ) {
                                foreach ( $inputData['aliases'] as $k => $v ) {
-                                       $entity->setAliases( $k, $v );
+                                       $item->setAliases( $k, $v );
                                }
                        }
                }
 
                // save entity ----------------------------------
                $titleLookup = $this->getEntityTitleLookup();
-               $editEntity = $this->makeEditEntity( $repo, $entity, 
$titleLookup, $user, $baseRevisionId );
+               $editEntity = $this->makeEditEntity( $repo, $item, 
$titleLookup, $user, $baseRevisionId );
 
                $conflict = $editEntity->hasEditConflict();
                $this->assertEquals( $expectedConflict, $conflict, 
'hasEditConflict()' );
@@ -333,7 +334,9 @@
                }
 
                if ( $expectedData !== null ) {
-                       $data = $this->fingerprintToPartialArray( 
$editEntity->getNewEntity()->getFingerprint() );
+                       /** @var Item $newEntity */
+                       $newEntity = $editEntity->getNewEntity();
+                       $data = $this->fingerprintToPartialArray( 
$newEntity->getFingerprint() );
 
                        foreach ( $expectedData as $key => $expectedValue ) {
                                $actualValue = $data[$key];

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib4c5387f2fa58cd787d376d95d588a7593e9da8c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Bene <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Bene <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to