Thiemo Mättig (WMDE) has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378723 )
Change subject: Make Wikibase code base compatible with current DataModel master ...................................................................... Make Wikibase code base compatible with current DataModel master Calling Item::setId or Property::setId with an integer is not supported any more. We are not using this new DataModel version at the moment, but I am using it's current master in my dev environment. Bug: T151577 Change-Id: I85931ad0d6d1eceef2b0e63906e05ed1d49b055f --- M lib/tests/phpunit/Changes/TestChanges.php M lib/tests/phpunit/EntityRevisionLookupTest.php M lib/tests/phpunit/MockRepositoryTest.php M repo/tests/phpunit/includes/Validators/EntityExistsValidatorTest.php 4 files changed, 6 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/23/378723/1 diff --git a/lib/tests/phpunit/Changes/TestChanges.php b/lib/tests/phpunit/Changes/TestChanges.php index e876cc0..ec0024d 100644 --- a/lib/tests/phpunit/Changes/TestChanges.php +++ b/lib/tests/phpunit/Changes/TestChanges.php @@ -52,18 +52,15 @@ $changeFactory = self::getEntityChangeFactory(); if ( empty( $changes ) ) { - $empty = Property::newFromType( 'string' ); - $empty->setId( 100 ); + $empty = new Property( new PropertyId( 'P100' ), null, 'string' ); $changes['property-creation'] = $changeFactory->newFromUpdate( EntityChange::ADD, null, $empty ); $changes['property-deletion'] = $changeFactory->newFromUpdate( EntityChange::REMOVE, $empty, null ); // ----- - $old = Property::newFromType( 'string' ); - $old->setId( 100 ); + $old = new Property( new PropertyId( 'P100' ), null, 'string' ); - $new = Property::newFromType( 'string' ); - $new->setId( 100 ); + $new = new Property( new PropertyId( 'P100' ), null, 'string' ); $new->setLabel( "de", "dummy" ); $changes['property-set-label'] = $changeFactory->newFromUpdate( EntityChange::UPDATE, $old, $new ); diff --git a/lib/tests/phpunit/EntityRevisionLookupTest.php b/lib/tests/phpunit/EntityRevisionLookupTest.php index ecf2692..79562f1 100644 --- a/lib/tests/phpunit/EntityRevisionLookupTest.php +++ b/lib/tests/phpunit/EntityRevisionLookupTest.php @@ -38,8 +38,7 @@ $entities[12] = new EntityRevision( $item, 12, '20130101001200' ); - $prop = Property::newFromType( "string" ); - $prop->setId( 753 ); + $prop = new Property( new PropertyId( 'P753' ), null, 'string' ); $entities[13] = new EntityRevision( $prop, 13, '20130101001300' ); diff --git a/lib/tests/phpunit/MockRepositoryTest.php b/lib/tests/phpunit/MockRepositoryTest.php index 759d567..ece40cb 100644 --- a/lib/tests/phpunit/MockRepositoryTest.php +++ b/lib/tests/phpunit/MockRepositoryTest.php @@ -300,8 +300,7 @@ $three->setLabel( 'de', 'drei' ); $three->setDescription( 'en', 'the third' ); - $prop = Property::newFromType( 'string' ); - $prop->setId( 4 ); + $prop = new Property( new PropertyId( 'P4' ), null, 'string' ); $prop->setLabel( 'en', 'property!' ); $this->repo->putEntity( $one, 1001 ); diff --git a/repo/tests/phpunit/includes/Validators/EntityExistsValidatorTest.php b/repo/tests/phpunit/includes/Validators/EntityExistsValidatorTest.php index 985cba0..ed1f000 100644 --- a/repo/tests/phpunit/includes/Validators/EntityExistsValidatorTest.php +++ b/repo/tests/phpunit/includes/Validators/EntityExistsValidatorTest.php @@ -30,8 +30,7 @@ private function getEntityLookup() { $q8 = new Item( new ItemId( 'Q8' ) ); - $p8 = Property::newFromType( 'string' ); - $p8->setId( 8 ); + $p8 = new Property( new PropertyId( 'P8' ), null, 'string' ); $entityLookup = new MockRepository(); $entityLookup->putEntity( $q8 ); -- To view, visit https://gerrit.wikimedia.org/r/378723 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I85931ad0d6d1eceef2b0e63906e05ed1d49b055f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits