Tamslo has uploaded a new change for review. https://gerrit.wikimedia.org/r/207857
Change subject: Renamed constraintClaimGuid in ViolationQuery ...................................................................... Renamed constraintClaimGuid in ViolationQuery Change-Id: I987466fd4f9ffaee3a545cd6b1341c763f811a5a --- M api/ModifyViolation.php M includes/Violations/ViolationQuery.php M tests/phpunit/Violations/ViolationLookupTest.php M tests/phpunit/Violations/ViolationQueryTest.php 4 files changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikidataQuality refs/changes/57/207857/1 diff --git a/api/ModifyViolation.php b/api/ModifyViolation.php index a820671..203332c 100644 --- a/api/ModifyViolation.php +++ b/api/ModifyViolation.php @@ -82,7 +82,7 @@ private function modifyViolationStatus( $claimGuid, $constraintId, $newStatus ) { $query = new ViolationQuery(); $query->setClaimGuid( $claimGuid ); - $query->setConstraintClaimGuid( $constraintId ); + $query->setConstraintId( $constraintId ); $violationArray = $this->violationLookup->getWhere( $query ); diff --git a/includes/Violations/ViolationQuery.php b/includes/Violations/ViolationQuery.php index b0cb442..c180b2c 100644 --- a/includes/Violations/ViolationQuery.php +++ b/includes/Violations/ViolationQuery.php @@ -97,13 +97,13 @@ /** * @param $constraintId */ - public function setConstraintClaimGuid( $constraintId ) { + public function setConstraintId( $constraintId ) { $this->testParamType( $constraintId, __FUNCTION__ ); $key = $this->keys[ 'constraintId' ]; $this->conditions[ $key ] = $key . '="' . $constraintId . '"'; } - public function unsetConstraintClaimGuid() { + public function unsetConstraintId() { unset( $this->conditions[ $this->keys[ 'constraintId' ] ] ); } diff --git a/tests/phpunit/Violations/ViolationLookupTest.php b/tests/phpunit/Violations/ViolationLookupTest.php index 0826a7d..04530e2 100644 --- a/tests/phpunit/Violations/ViolationLookupTest.php +++ b/tests/phpunit/Violations/ViolationLookupTest.php @@ -26,7 +26,7 @@ $violationQuery = new ViolationQuery(); $violationQuery->setClaimGuid( 'P13$aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' ); - $violationQuery->setConstraintClaimGuid( 'P667$aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' ); + $violationQuery->setConstraintId( 'P667$aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' ); $queryResult = $violationLookup->getWhere( $violationQuery ); $this->assertEquals( 1, count( $queryResult ) ); diff --git a/tests/phpunit/Violations/ViolationQueryTest.php b/tests/phpunit/Violations/ViolationQueryTest.php index 26987e0..790233f 100644 --- a/tests/phpunit/Violations/ViolationQueryTest.php +++ b/tests/phpunit/Violations/ViolationQueryTest.php @@ -27,7 +27,7 @@ $conditionArray = $queryCondition->toArray(); $this->assertEquals( 'pid="value"', $conditionArray[ 1 ], "Test PropertyIdSetter" ); - $queryCondition->setConstraintClaimGuid( 'value' ); + $queryCondition->setConstraintId( 'value' ); $conditionArray = $queryCondition->toArray(); $this->assertEquals( 'constraint_id="value"', $conditionArray[ 2 ], "Test ConstraintClaimGuidSetter" ); @@ -64,7 +64,7 @@ $queryCondition->setEntityId( 'value' ); $queryCondition->setPropertyId( 'value' ); $queryCondition->setClaimGuid( 'value' ); - $queryCondition->setConstraintClaimGuid( 'value' ); + $queryCondition->setConstraintId( 'value' ); $queryCondition->setConstraintTypeEntityId( 'value' ); $queryCondition->setAdditionalInfo( 'value' ); $queryCondition->setUpdatedAt( 'value' ); @@ -82,7 +82,7 @@ $queryCondition->unsetClaimGuid(); $this->assertEquals( --$count, count( $queryCondition->toArray() ), "Test ClaimGuidUnsetter" ); - $queryCondition->unsetConstraintClaimGuid(); + $queryCondition->unsetConstraintId(); $this->assertEquals( --$count, count( $queryCondition->toArray() ), "Test ConstraintClaimGuidUnsetter" ); $queryCondition->unsetConstraintTypeEntityId(); -- To view, visit https://gerrit.wikimedia.org/r/207857 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I987466fd4f9ffaee3a545cd6b1341c763f811a5a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikidataQuality Gerrit-Branch: master Gerrit-Owner: Tamslo <tamaraslosa...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits