Addshore has uploaded a new change for review.

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

Change subject: Use StatementGuidValidator from DataModelServices
......................................................................

Use StatementGuidValidator from DataModelServices

Change-Id: I82112bf3272991ae4b356e75f9b4dedbcfc5bdfe
---
D lib/includes/ClaimGuidValidator.php
D lib/tests/phpunit/ClaimGuidValidatorTest.php
M repo/includes/ChangeOp/ChangeOpFactoryProvider.php
M repo/includes/ChangeOp/ChangeOpStatement.php
M repo/includes/ChangeOp/StatementChangeOpFactory.php
M repo/includes/WikibaseRepo.php
M repo/includes/api/GetClaims.php
M repo/includes/api/ModifyClaim.php
M repo/includes/api/StatementModificationHelper.php
M repo/tests/phpunit/includes/ChangeOp/ChangeOpStatementTest.php
M repo/tests/phpunit/includes/ChangeOp/ChangeOpTestMockProvider.php
M repo/tests/phpunit/includes/WikibaseRepoTest.php
M repo/tests/phpunit/includes/api/MergeItemsTest.php
M repo/tests/phpunit/includes/api/StatementModificationHelperTest.php
14 files changed, 36 insertions(+), 268 deletions(-)


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

diff --git a/lib/includes/ClaimGuidValidator.php 
b/lib/includes/ClaimGuidValidator.php
deleted file mode 100644
index 3a69e0e..0000000
--- a/lib/includes/ClaimGuidValidator.php
+++ /dev/null
@@ -1,114 +0,0 @@
-<?php
-
-namespace Wikibase\Lib;
-
-use Wikibase\DataModel\Services\EntityId\EntityIdParser;
-use Wikibase\DataModel\Services\EntityId\EntityIdParsingException;
-use Wikibase\DataModel\Statement\StatementGuid;
-
-/**
- * @since 0.4
- *
- * @licence GNU GPL v2+
- * @author Katie Filbert < aude.w...@gmail.com >
- */
-class ClaimGuidValidator {
-
-       /**
-        * @var EntityIdParser
-        */
-       protected $entityIdParser;
-
-       /**
-        * @param EntityIdParser $entityIdParser
-        */
-       public function __construct( EntityIdParser $entityIdParser ) {
-               $this->entityIdParser = $entityIdParser;
-       }
-
-       /**
-        * Validates a claim guid
-        *
-        * @since 0.4
-        *
-        * @param string $guid
-        *
-        * @return boolean
-        */
-       public function validate( $guid ) {
-               if ( ! $this->validateFormat( $guid ) ) {
-                       return false;
-               }
-
-               $guidParts = explode( StatementGuid::SEPARATOR, $guid );
-
-               if ( ! $this->validateClaimGuidPrefix( $guidParts[0] ) || ! 
$this->validateGuid( $guidParts[1] ) ) {
-                       return false;
-               }
-
-               return true;
-       }
-
-       /**
-        * Basic validation for claim guid format
-        *
-        * @since 0.4
-        *
-        * @param string $guid
-        *
-        * @return boolean
-        */
-       public function validateFormat( $guid ) {
-               if ( ! is_string( $guid ) ) {
-                       return false;
-               }
-
-               $keyParts = explode( '$', $guid );
-
-               if ( count( $keyParts ) !== 2 ) {
-                       wfDebugLog( __CLASS__, __METHOD__ . ': claim guid does 
not have the correct number of parts.' );
-                       return false;
-               }
-
-               return true;
-       }
-
-       /**
-        * Validate the second part of a claim guid, after the $
-        *
-        * @since 0.4
-        *
-        * @param string $guid
-        *
-        * @return boolean
-        */
-       protected function validateGuid( $guid ) {
-               $guidFormat = 
'/^\{?[A-Z\d]{8}-[A-Z\d]{4}-[A-Z\d]{4}-[A-Z\d]{4}-[A-Z\d]{12}\}?$/i';
-
-               if ( !preg_match( $guidFormat, $guid ) ) {
-                       wfDebugLog( __CLASS__, __METHOD__ . ': claim guid param 
has an invalid format.' );
-                       return false;
-               }
-
-               return true;
-       }
-
-       /**
-        * Validate the claim guid prefix is a valid entity id
-        *
-        * @since 0.4
-        *
-        * @param $prefixedId
-        *
-        * @return boolean
-        */
-       protected function validateClaimGuidPrefix( $prefixedId ) {
-               try {
-                       $this->entityIdParser->parse( $prefixedId );
-                       return true;
-               } catch ( EntityIdParsingException $ex ) {
-                       return false;
-               }
-       }
-
-}
diff --git a/lib/tests/phpunit/ClaimGuidValidatorTest.php 
b/lib/tests/phpunit/ClaimGuidValidatorTest.php
deleted file mode 100644
index 34dbb09..0000000
--- a/lib/tests/phpunit/ClaimGuidValidatorTest.php
+++ /dev/null
@@ -1,119 +0,0 @@
-<?php
-
-namespace Wikibase\Lib\Test;
-
-use Wikibase\DataModel\Services\EntityId\BasicEntityIdParser;
-use Wikibase\Lib\ClaimGuidValidator;
-
-/**
- * @covers Wikibase\Lib\ClaimGuidValidator
- *
- * @group Wikibase
- * @group WikibaseLib
- *
- * @licence GNU GPL v2+
- * @author Katie Filbert < aude.w...@gmail.com >
- */
-class ClaimGuidValidatorTest extends \PHPUnit_Framework_TestCase {
-
-       protected function newClaimGuidValidator() {
-               $entityIdParser = new BasicEntityIdParser();
-               return new ClaimGuidValidator( $entityIdParser );
-       }
-
-       /**
-        * @dataProvider validateProvider
-        */
-       public function testValidate( $guid ) {
-               $claimGuidValidator = $this->newClaimGuidValidator();
-               $isValid = $claimGuidValidator->validate( $guid );
-
-               $this->assertTrue( $isValid, "Assert that claim guid $guid is 
valid" );
-       }
-
-       public function validateProvider() {
-               return array(
-                       array( 'q60$5083E43C-228B-4E3E-B82A-4CB20A22A3FB' ),
-                       array( 'q604192$5672A3B1-7693-4DF9-ADE8-8FC13E095604' ),
-                       array( 'q37$a212184b-434c-7e90-dd26-29eda5ee2580' ),
-                       array( 'Q60$5083E43C-228B-4E3E-B82A-4CB20A22A3FA' ),
-                       array( 'Q604192$5672A3B1-7693-4DF9-ADE8-8FC13E095603' ),
-                       array( 'Q37$a212184b-434c-7e90-dd26-29eda5ee2581' )
-               );
-       }
-
-       /**
-        * @dataProvider validateInvalidProvider
-        */
-       public function testValidateInvalid( $guid ) {
-               $claimGuidValidator = $this->newClaimGuidValidator();
-               $isValid = $claimGuidValidator->validate( $guid );
-
-               $this->assertFalse( $isValid, "Assert that claim guid $guid is 
invalid" );
-       }
-
-       public function validateInvalidProvider() {
-               return array(
-                       array( 'q60$5083E43C-228B-4E3E-B82A-4CB20A22A3F' ),
-                       array( 'q60$5083E43C-228B-4E3E-B82A-$4CB20A22A3FB' ),
-                       array( '$q60$5083E43C-228B-4E3E-B82A-4CB20A22A3FB' ),
-                       array( '5083E43C-228B-4E3E-B82A-4CB20A22A3FB' ),
-                       array( 9000 ),
-                       array( 'q604192$56723B1-7693-4DF9-ADE8-8FC13E095604' ),
-                       array( 'q604192$5672w3B1-693-4DF9-ADE8-8FC13E095604' ),
-                       array( 'q604192$5672w3B1-6935-4F9-ADE8-8FC13E095604' ),
-                       array( 'q604192$5672w3B1-6935-4DF9-AD8-8FC13E095604' ),
-                       array( 'q604192$5672w3B1-6935-4DF9-ADE8-8FC13E09604' ),
-                       array( 'q604192$5672A3B1--7693-4DF9-ADE8-8FC13E095604' 
),
-                       array( 'foo' ),
-                       array( 'q12345' )
-               );
-       }
-
-       /**
-        * @dataProvider validateProvider
-        */
-       public function testValidateFormat( $guid ) {
-               $claimGuidValidator = $this->newClaimGuidValidator();
-               $isValid = $claimGuidValidator->validate( $guid );
-
-               $this->assertTrue( $isValid, "Assert that claim guid $guid has 
a valid format." );
-       }
-
-       /**
-        * @dataProvider invalidFormatProvider
-        */
-       public function  testInvalidFormat( $guid ) {
-               $claimGuidValidator = $this->newClaimGuidValidator();
-               $isValid = $claimGuidValidator->validate( $guid );
-
-               $this->assertFalse( $isValid, "Assert that claim guid $guid has 
an invalid format." );
-       }
-
-       public function invalidFormatProvider() {
-               return array(
-                       array( 'q12345' ),
-                       array( 'q$1$2$3' ),
-                       array( '$q60$5083E43C-228B-4E3E-B82A-4CB20A22A3FB' )
-               );
-       }
-
-       /**
-        * @dataProvider validateInvalidPrefixedIdProvider
-        */
-       public function testValidateInvalidPrefixedId( $guid ) {
-               $claimGuidValidator = $this->newClaimGuidValidator();
-
-               $isValid = $claimGuidValidator->validate( $guid );
-
-               $this->assertFalse( $isValid, "Assert that claim guid prefix is 
invalid" );
-       }
-
-       public function validateInvalidPrefixedIdProvider() {
-               return array(
-                       array( '060$5083E43C-228B-4E3E-B82A-4CB20A22A3FB' ),
-                       array( 'a060$5083E43C-228B-4E3E-B82A-4CB20A22A3FB' )
-               );
-       }
-
-}
diff --git a/repo/includes/ChangeOp/ChangeOpFactoryProvider.php 
b/repo/includes/ChangeOp/ChangeOpFactoryProvider.php
index 2533ac8..3068f01 100644
--- a/repo/includes/ChangeOp/ChangeOpFactoryProvider.php
+++ b/repo/includes/ChangeOp/ChangeOpFactoryProvider.php
@@ -5,7 +5,7 @@
 use SiteLookup;
 use Wikibase\DataModel\Services\Statement\GuidGenerator;
 use Wikibase\DataModel\Services\Statement\StatementGuidParser;
-use Wikibase\Lib\ClaimGuidValidator;
+use Wikibase\DataModel\Services\Statement\StatementGuidValidator;
 use Wikibase\Repo\Validators\EntityConstraintProvider;
 use Wikibase\Repo\Validators\SnakValidator;
 use Wikibase\Repo\Validators\TermValidatorFactory;
@@ -31,7 +31,7 @@
        private $guidGenerator;
 
        /**
-        * @var ClaimGuidValidator
+        * @var StatementGuidValidator
         */
        private $guidValidator;
 
@@ -58,7 +58,7 @@
        /**
         * @param EntityConstraintProvider $constraintProvider
         * @param GuidGenerator $guidGenerator
-        * @param ClaimGuidValidator $guidValidator
+        * @param StatementGuidValidator $guidValidator
         * @param StatementGuidParser $guidParser
         * @param SnakValidator $snakValidator
         * @param TermValidatorFactory $termValidatorFactory
@@ -67,7 +67,7 @@
        public function __construct(
                EntityConstraintProvider $constraintProvider,
                GuidGenerator $guidGenerator,
-               ClaimGuidValidator $guidValidator,
+               StatementGuidValidator $guidValidator,
                StatementGuidParser $guidParser,
                SnakValidator $snakValidator,
                TermValidatorFactory $termValidatorFactory,
diff --git a/repo/includes/ChangeOp/ChangeOpStatement.php 
b/repo/includes/ChangeOp/ChangeOpStatement.php
index 4d371cb..234d3d3 100644
--- a/repo/includes/ChangeOp/ChangeOpStatement.php
+++ b/repo/includes/ChangeOp/ChangeOpStatement.php
@@ -9,10 +9,10 @@
 use Wikibase\DataModel\Entity\Entity;
 use Wikibase\DataModel\Services\Statement\GuidGenerator;
 use Wikibase\DataModel\Services\Statement\StatementGuidParser;
+use Wikibase\DataModel\Services\Statement\StatementGuidValidator;
 use Wikibase\DataModel\Statement\Statement;
 use Wikibase\DataModel\Statement\StatementList;
 use Wikibase\DataModel\Statement\StatementListHolder;
-use Wikibase\Lib\ClaimGuidValidator;
 use Wikibase\Summary;
 use Wikibase\Repo\Validators\SnakValidator;
 
@@ -39,7 +39,7 @@
        private $guidGenerator;
 
        /**
-        * @var ClaimGuidValidator
+        * @var StatementGuidValidator
         */
        private $guidValidator;
 
@@ -61,7 +61,7 @@
        /**
         * @param Statement $statement
         * @param GuidGenerator $guidGenerator
-        * @param ClaimGuidValidator $guidValidator
+        * @param StatementGuidValidator $guidValidator
         * @param StatementGuidParser $guidParser
         * @param SnakValidator $snakValidator
         * @param int|null $index Where the claim should be placed among the 
other claims.
@@ -71,7 +71,7 @@
        public function __construct(
                Statement $statement,
                GuidGenerator $guidGenerator,
-               ClaimGuidValidator $guidValidator,
+               StatementGuidValidator $guidValidator,
                StatementGuidParser $guidParser,
                SnakValidator $snakValidator,
                $index = null
diff --git a/repo/includes/ChangeOp/StatementChangeOpFactory.php 
b/repo/includes/ChangeOp/StatementChangeOpFactory.php
index 77a085b..65ef546 100644
--- a/repo/includes/ChangeOp/StatementChangeOpFactory.php
+++ b/repo/includes/ChangeOp/StatementChangeOpFactory.php
@@ -6,9 +6,9 @@
 use Wikibase\DataModel\Reference;
 use Wikibase\DataModel\Services\Statement\GuidGenerator;
 use Wikibase\DataModel\Services\Statement\StatementGuidParser;
+use Wikibase\DataModel\Services\Statement\StatementGuidValidator;
 use Wikibase\DataModel\Snak\Snak;
 use Wikibase\DataModel\Statement\Statement;
-use Wikibase\Lib\ClaimGuidValidator;
 use Wikibase\Repo\Validators\SnakValidator;
 
 /**
@@ -25,7 +25,7 @@
        private $guidGenerator;
 
        /**
-        * @var ClaimGuidValidator
+        * @var StatementGuidValidator
         */
        private $guidValidator;
 
@@ -46,7 +46,7 @@
 
        public function __construct(
                GuidGenerator $guidGenerator,
-               ClaimGuidValidator $guidValidator,
+               StatementGuidValidator $guidValidator,
                StatementGuidParser $guidParser,
                SnakValidator $snakValidator,
                SnakValidator $referenceSnakValidator
diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php
index 9ea1dfb..472bb27 100644
--- a/repo/includes/WikibaseRepo.php
+++ b/repo/includes/WikibaseRepo.php
@@ -29,6 +29,7 @@
 use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookup;
 use Wikibase\DataModel\Services\Statement\GuidGenerator;
 use Wikibase\DataModel\Services\Statement\StatementGuidParser;
+use Wikibase\DataModel\Services\Statement\StatementGuidValidator;
 use Wikibase\EditEntityFactory;
 use Wikibase\EntityFactory;
 use Wikibase\EntityParserOutputGeneratorFactory;
@@ -37,7 +38,6 @@
 use Wikibase\LabelDescriptionDuplicateDetector;
 use Wikibase\LanguageFallbackChainFactory;
 use Wikibase\Lib\Changes\EntityChangeFactory;
-use Wikibase\Lib\ClaimGuidValidator;
 use Wikibase\Lib\ContentLanguages;
 use Wikibase\Lib\DispatchingValueFormatter;
 use Wikibase\Lib\EntityIdLinkFormatter;
@@ -135,9 +135,9 @@
        private $languageFallbackChainFactory = null;
 
        /**
-        * @var ClaimGuidValidator|null
+        * @var StatementGuidValidator|null
         */
-       private $claimGuidValidator = null;
+       private $statementGuidValidator = null;
 
        /**
         * @var EntityIdParser|null
@@ -471,7 +471,7 @@
                return new ChangeOpFactoryProvider(
                        $this->getEntityConstraintProvider(),
                        new GuidGenerator(),
-                       $this->getClaimGuidValidator(),
+                       $this->getStatementGuidValidator(),
                        $this->getStatementGuidParser(),
                        $this->getSnakValidator(),
                        $this->getTermValidatorFactory(),
@@ -531,14 +531,14 @@
        /**
         * @since 0.4
         *
-        * @return ClaimGuidValidator
+        * @return StatementGuidValidator
         */
-       public function getClaimGuidValidator() {
-               if ( $this->claimGuidValidator === null ) {
-                       $this->claimGuidValidator = new ClaimGuidValidator( 
$this->getEntityIdParser() );
+       public function getStatementGuidValidator() {
+               if ( $this->statementGuidValidator === null ) {
+                       $this->statementGuidValidator = new 
StatementGuidValidator( $this->getEntityIdParser() );
                }
 
-               return $this->claimGuidValidator;
+               return $this->statementGuidValidator;
        }
 
        /**
diff --git a/repo/includes/api/GetClaims.php b/repo/includes/api/GetClaims.php
index b5b276f..d27988b 100644
--- a/repo/includes/api/GetClaims.php
+++ b/repo/includes/api/GetClaims.php
@@ -9,10 +9,10 @@
 use Wikibase\DataModel\Services\EntityId\EntityIdParser;
 use Wikibase\DataModel\Services\EntityId\EntityIdParsingException;
 use Wikibase\DataModel\Services\Statement\StatementGuidParser;
+use Wikibase\DataModel\Services\Statement\StatementGuidValidator;
 use Wikibase\DataModel\Statement\Statement;
 use Wikibase\DataModel\Statement\StatementList;
 use Wikibase\DataModel\Statement\StatementListProvider;
-use Wikibase\Lib\ClaimGuidValidator;
 use Wikibase\Lib\Store\EntityRevisionLookup;
 use Wikibase\Repo\WikibaseRepo;
 use Wikibase\StatementRankSerializer;
@@ -29,7 +29,7 @@
 class GetClaims extends ApiBase {
 
        /**
-        * @var ClaimGuidValidator
+        * @var StatementGuidValidator
         */
        private $guidValidator;
 
@@ -74,7 +74,7 @@
                $this->errorReporter = $apiHelperFactory->getErrorReporter( 
$this );
                $this->resultBuilder = $apiHelperFactory->getResultBuilder( 
$this );
                $this->entityLoadingHelper = 
$apiHelperFactory->getEntityLoadingHelper( $this );
-               $this->guidValidator = $wikibaseRepo->getClaimGuidValidator();
+               $this->guidValidator = 
$wikibaseRepo->getStatementGuidValidator();
                $this->guidParser = $wikibaseRepo->getStatementGuidParser();
                $this->idParser = $wikibaseRepo->getEntityIdParser();
        }
diff --git a/repo/includes/api/ModifyClaim.php 
b/repo/includes/api/ModifyClaim.php
index 0f3696f..d5faa32 100644
--- a/repo/includes/api/ModifyClaim.php
+++ b/repo/includes/api/ModifyClaim.php
@@ -68,7 +68,7 @@
                $this->modificationHelper = new StatementModificationHelper(
                        $wikibaseRepo->getSnakConstructionService(),
                        $wikibaseRepo->getEntityIdParser(),
-                       $wikibaseRepo->getClaimGuidValidator(),
+                       $wikibaseRepo->getStatementGuidValidator(),
                        $apiHelperFactory->getErrorReporter( $this )
                );
 
diff --git a/repo/includes/api/StatementModificationHelper.php 
b/repo/includes/api/StatementModificationHelper.php
index 395b206..2442292 100644
--- a/repo/includes/api/StatementModificationHelper.php
+++ b/repo/includes/api/StatementModificationHelper.php
@@ -18,10 +18,10 @@
 use Wikibase\DataModel\Services\EntityId\EntityIdParser;
 use Wikibase\DataModel\Services\EntityId\EntityIdParsingException;
 use Wikibase\DataModel\Services\Lookup\PropertyNotFoundException;
+use Wikibase\DataModel\Services\Statement\StatementGuidValidator;
 use Wikibase\DataModel\Snak\Snak;
 use Wikibase\DataModel\Statement\Statement;
 use Wikibase\DataModel\Statement\StatementListProvider;
-use Wikibase\Lib\ClaimGuidValidator;
 use Wikibase\Repo\SnakConstructionService;
 use Wikibase\Summary;
 
@@ -49,21 +49,22 @@
        private $entityIdParser;
 
        /**
-        * @var ClaimGuidValidator
+        * @var StatementGuidValidator
         */
        private $guidValidator;
 
        /**
         * @var ApiErrorReporter
+        *
         * @param SnakConstructionService $snakConstructionService
         * @param EntityIdParser $entityIdParser
-        * @param ClaimGuidValidator $guidValidator
+        * @param StatementGuidValidator $guidValidator
         * @param ApiErrorReporter $errorReporter
         */
        public function __construct(
                SnakConstructionService $snakConstructionService,
                EntityIdParser $entityIdParser,
-               ClaimGuidValidator $guidValidator,
+               StatementGuidValidator $guidValidator,
                ApiErrorReporter $errorReporter
        ) {
                $this->snakConstructionService = $snakConstructionService;
diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpStatementTest.php 
b/repo/tests/phpunit/includes/ChangeOp/ChangeOpStatementTest.php
index c24f63d..5606de7 100644
--- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpStatementTest.php
+++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpStatementTest.php
@@ -15,6 +15,7 @@
 use Wikibase\DataModel\Services\EntityId\BasicEntityIdParser;
 use Wikibase\DataModel\Services\Statement\GuidGenerator;
 use Wikibase\DataModel\Services\Statement\StatementGuidParser;
+use Wikibase\DataModel\Services\Statement\StatementGuidValidator;
 use Wikibase\DataModel\Snak\PropertyNoValueSnak;
 use Wikibase\DataModel\Snak\PropertySomeValueSnak;
 use Wikibase\DataModel\Snak\PropertyValueSnak;
@@ -22,7 +23,6 @@
 use Wikibase\DataModel\Snak\SnakList;
 use Wikibase\DataModel\Statement\Statement;
 use Wikibase\DataModel\Statement\StatementList;
-use Wikibase\Lib\ClaimGuidValidator;
 
 /**
  * @covers Wikibase\ChangeOp\ChangeOpStatement
@@ -272,7 +272,7 @@
                return new ChangeOpStatement(
                        $statement,
                        new GuidGenerator(),
-                       new ClaimGuidValidator( $idParser ),
+                       new StatementGuidValidator( $idParser ),
                        new StatementGuidParser( $idParser ),
                        $this->mockProvider->getMockSnakValidator(),
                        $index
diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpTestMockProvider.php 
b/repo/tests/phpunit/includes/ChangeOp/ChangeOpTestMockProvider.php
index a406b3e..75715d7 100644
--- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpTestMockProvider.php
+++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpTestMockProvider.php
@@ -20,11 +20,11 @@
 use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookup;
 use Wikibase\DataModel\Services\Statement\GuidGenerator;
 use Wikibase\DataModel\Services\Statement\StatementGuidParser;
+use Wikibase\DataModel\Services\Statement\StatementGuidValidator;
 use Wikibase\DataModel\Snak\PropertyNoValueSnak;
 use Wikibase\DataModel\Snak\PropertyValueSnak;
 use Wikibase\DataModel\Statement\Statement;
 use Wikibase\LabelDescriptionDuplicateDetector;
-use Wikibase\Lib\ClaimGuidValidator;
 use Wikibase\Lib\Store\SiteLinkConflictLookup;
 use Wikibase\Repo\DataTypeValidatorFactory;
 use Wikibase\Repo\Validators\CompositeFingerprintValidator;
@@ -121,7 +121,7 @@
        /**
         * Returns a mock ClaimGuidValidator that accepts any GUID.
         *
-        * @return ClaimGuidValidator
+        * @return StatementGuidValidator
         */
        public function getMockGuidValidator() {
                $mock = $this->getMockBuilder( 
'\Wikibase\Lib\ClaimGuidValidator' )
diff --git a/repo/tests/phpunit/includes/WikibaseRepoTest.php 
b/repo/tests/phpunit/includes/WikibaseRepoTest.php
index c7fd55b..ce35cc5 100644
--- a/repo/tests/phpunit/includes/WikibaseRepoTest.php
+++ b/repo/tests/phpunit/includes/WikibaseRepoTest.php
@@ -95,7 +95,7 @@
        }
 
        public function testGetClaimGuidValidator() {
-               $returnValue = 
$this->getWikibaseRepo()->getClaimGuidValidator();
+               $returnValue = 
$this->getWikibaseRepo()->getStatementGuidValidator();
                $this->assertInstanceOf( 'Wikibase\Lib\ClaimGuidValidator', 
$returnValue );
        }
 
diff --git a/repo/tests/phpunit/includes/api/MergeItemsTest.php 
b/repo/tests/phpunit/includes/api/MergeItemsTest.php
index c48a4d3..2ccea34 100644
--- a/repo/tests/phpunit/includes/api/MergeItemsTest.php
+++ b/repo/tests/phpunit/includes/api/MergeItemsTest.php
@@ -139,7 +139,7 @@
                $changeOpsFactoryProvider = new ChangeOpFactoryProvider(
                        $this->getConstraintProvider(),
                        new GuidGenerator(),
-                       
WikibaseRepo::getDefaultInstance()->getClaimGuidValidator(),
+                       
WikibaseRepo::getDefaultInstance()->getStatementGuidValidator(),
                        
WikibaseRepo::getDefaultInstance()->getStatementGuidParser(),
                        $this->getSnakValidator(),
                        $this->getTermValidatorFactory(),
diff --git 
a/repo/tests/phpunit/includes/api/StatementModificationHelperTest.php 
b/repo/tests/phpunit/includes/api/StatementModificationHelperTest.php
index ce52f0e..33d5371 100644
--- a/repo/tests/phpunit/includes/api/StatementModificationHelperTest.php
+++ b/repo/tests/phpunit/includes/api/StatementModificationHelperTest.php
@@ -95,7 +95,7 @@
                $helper = new StatementModificationHelper(
                        
WikibaseRepo::getDefaultInstance()->getSnakConstructionService(),
                        WikibaseRepo::getDefaultInstance()->getEntityIdParser(),
-                       
WikibaseRepo::getDefaultInstance()->getClaimGuidValidator(),
+                       
WikibaseRepo::getDefaultInstance()->getStatementGuidValidator(),
                        $errorReporter
                );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I82112bf3272991ae4b356e75f9b4dedbcfc5bdfe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore <addshorew...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to