Jeroen De Dauw has uploaded a new change for review.
https://gerrit.wikimedia.org/r/85528
Change subject: Match DataType updating in DataTypes component [DNM]
......................................................................
Match DataType updating in DataTypes component [DNM]
Change-Id: I0c4d0ed53ee8163ca94c6b6bccb873ffc7cae840
---
M lib/includes/WikibaseDataTypeBuilders.php
M lib/tests/phpunit/SnakConstructionServiceTest.php
M lib/tests/phpunit/WikibaseDataTypeBuildersTest.php
M repo/tests/phpunit/includes/Validators/SnakValidatorTest.php
M repo/tests/phpunit/includes/api/SnakValidationHelperTest.php
5 files changed, 13 insertions(+), 44 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/28/85528/1
diff --git a/lib/includes/WikibaseDataTypeBuilders.php
b/lib/includes/WikibaseDataTypeBuilders.php
index d41f50b..f34ec3f 100644
--- a/lib/includes/WikibaseDataTypeBuilders.php
+++ b/lib/includes/WikibaseDataTypeBuilders.php
@@ -23,9 +23,6 @@
*
* @since 0.4
*
- * @file
- * @ingroup WikibaseLib
- *
* @licence GNU GPL v2+
* @author Daniel Kinzler
*/
@@ -100,7 +97,7 @@
$validators[] = new TypeValidator(
'Wikibase\DataModel\Entity\EntityIdValue' );
$validators[] = new EntityExistsValidator( $this->entityLookup
);
- return new DataType( $id, 'wikibase-entityid', array(),
array(), $validators );
+ return new DataType( $id, 'wikibase-entityid', $validators );
}
public function buildMediaType( $id ) {
@@ -119,7 +116,7 @@
new CompositeValidator( $validators, true ) //Note:
each validator is fatal
);
- return new DataType( $id, 'string', array(), array(), array(
new TypeValidator( 'DataValues\DataValue' ), $topValidator ) );
+ return new DataType( $id, 'string', array( new TypeValidator(
'DataValues\DataValue' ), $topValidator ) );
}
public function buildStringType( $id ) {
@@ -134,7 +131,7 @@
new CompositeValidator( $validators, true ) //Note:
each validator is fatal
);
- return new DataType( $id, 'string', array(), array(), array(
new TypeValidator( 'DataValues\DataValue' ), $topValidator ) );
+ return new DataType( $id, 'string', array( new TypeValidator(
'DataValues\DataValue' ), $topValidator ) );
}
public function buildTimeType( $id ) {
@@ -166,7 +163,7 @@
new CompositeValidator( $validators, true ) //Note:
each validator is fatal
);
- return new DataType( $id, 'time', array(), array(), array( new
TypeValidator( 'DataValues\DataValue' ), $topValidator ) );
+ return new DataType( $id, 'time', array( new TypeValidator(
'DataValues\DataValue' ), $topValidator ) );
}
public function buildCoordinateType( $id ) {
@@ -187,7 +184,7 @@
new CompositeValidator( $validators, true ) //Note:
each validator is fatal
);
- return new DataType( $id, 'globecoordinate', array(), array(),
array( new TypeValidator( 'DataValues\DataValue' ), $topValidator ) );
+ return new DataType( $id, 'globecoordinate', array( new
TypeValidator( 'DataValues\DataValue' ), $topValidator ) );
}
public function buildUrlValidator( $urlSchemes, $maxLength = 500 ) {
@@ -208,7 +205,7 @@
$urlValidator
);
- return new DataType( $id, 'string', array(), array(), array(
new TypeValidator( 'DataValues\DataValue' ), $topValidator ) );
+ return new DataType( $id, 'string', array( new TypeValidator(
'DataValues\DataValue' ), $topValidator ) );
}
}
diff --git a/lib/tests/phpunit/SnakConstructionServiceTest.php
b/lib/tests/phpunit/SnakConstructionServiceTest.php
index e1a3fa1..ca3d616 100644
--- a/lib/tests/phpunit/SnakConstructionServiceTest.php
+++ b/lib/tests/phpunit/SnakConstructionServiceTest.php
@@ -54,7 +54,7 @@
$dataTypeFactory = new DataTypeFactory();
$dataValueFactory = DataValueFactory::singleton();
- $dataTypeFactory->registerDataType( new DataType( 'string',
'string', array(), array(), array() ) );
+ $dataTypeFactory->registerDataType( new DataType( 'string',
'string', array() ) );
$dataTypeLookup->setDataTypeForProperty( new EntityId(
Property::ENTITY_TYPE, 1 ), 'string' );
$service = new SnakConstructionService(
diff --git a/lib/tests/phpunit/WikibaseDataTypeBuildersTest.php
b/lib/tests/phpunit/WikibaseDataTypeBuildersTest.php
index f846e84..0c53487 100644
--- a/lib/tests/phpunit/WikibaseDataTypeBuildersTest.php
+++ b/lib/tests/phpunit/WikibaseDataTypeBuildersTest.php
@@ -21,19 +21,12 @@
/**
* @covers Wikibase\Lib\WikibaseDataTypeBuilders
*
- * @license GPL 2+
- * @file
- *
- * @ingroup WikibaseLib
- * @ingroup Test
- *
* @group WikibaseLib
* @group Wikibase
* @group WikibaseValidators
*
+ * @license GPL 2+
* @author Daniel Kinzler
- *
- * @package Wikibase\Test
*/
class WikibaseDataTypeBuildersTest extends \PHPUnit_Framework_TestCase {
@@ -41,7 +34,7 @@
$entityIdParser = new EntityIdParser( new ParserOptions() );
$q8 = Item::newEmpty();
- $q8->setId( 8 );
+ $q8->setId( new ItemId( 'q8' ) );
$entityLookup = new MockRepository();
$entityLookup->putEntity( $q8 );
diff --git a/repo/tests/phpunit/includes/Validators/SnakValidatorTest.php
b/repo/tests/phpunit/includes/Validators/SnakValidatorTest.php
index 27f691a..0dab67d 100644
--- a/repo/tests/phpunit/includes/Validators/SnakValidatorTest.php
+++ b/repo/tests/phpunit/includes/Validators/SnakValidatorTest.php
@@ -75,8 +75,8 @@
$lengthValidator = new TestValidator( '/^.{1,10}$/' );
$this->dataTypeFactory = new DataTypeFactory();
- $this->dataTypeFactory->registerDataType( new DataType(
'numeric', 'string', array(), array(), array( $numericValidator,
$lengthValidator ) ) );
- $this->dataTypeFactory->registerDataType( new DataType(
'alphabetic', 'string', array(), array(), array( $alphabeticValidator,
$lengthValidator ) ) );
+ $this->dataTypeFactory->registerDataType( new DataType(
'numeric', 'string', array( $numericValidator, $lengthValidator ) ) );
+ $this->dataTypeFactory->registerDataType( new DataType(
'alphabetic', 'string', array( $alphabeticValidator, $lengthValidator ) ) );
$p1 = new EntityId( Property::ENTITY_TYPE, 1 );
$p2 = new EntityId( Property::ENTITY_TYPE, 2 );
diff --git a/repo/tests/phpunit/includes/api/SnakValidationHelperTest.php
b/repo/tests/phpunit/includes/api/SnakValidationHelperTest.php
index 399d548..a8ae52f 100644
--- a/repo/tests/phpunit/includes/api/SnakValidationHelperTest.php
+++ b/repo/tests/phpunit/includes/api/SnakValidationHelperTest.php
@@ -27,27 +27,6 @@
/**
* @covers Wikibase\Api\SnakValidationHelper
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @since 0.4
- *
- * @ingroup WikibaseRepoTest
- * @ingroup Test
- *
* @group Wikibase
* @group WikibaseValidators
* @group WikibaseAPI
@@ -75,8 +54,8 @@
$lengthValidator = new TestValidator( '/^.{1,10}$/' );
$this->dataTypeFactory = new DataTypeFactory();
- $this->dataTypeFactory->registerDataType( new DataType(
'numeric', 'string', array(), array(), array( $numericValidator,
$lengthValidator ) ) );
- $this->dataTypeFactory->registerDataType( new DataType(
'alphabetic', 'string', array(), array(), array( $alphabeticValidator,
$lengthValidator ) ) );
+ $this->dataTypeFactory->registerDataType( new DataType(
'numeric', 'string', array( $numericValidator, $lengthValidator ) ) );
+ $this->dataTypeFactory->registerDataType( new DataType(
'alphabetic', 'string', array( $alphabeticValidator, $lengthValidator ) ) );
$p1 = new EntityId( Property::ENTITY_TYPE, 1 );
$p2 = new EntityId( Property::ENTITY_TYPE, 2 );
--
To view, visit https://gerrit.wikimedia.org/r/85528
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c4d0ed53ee8163ca94c6b6bccb873ffc7cae840
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits