jenkins-bot has submitted this change and it was merged.
Change subject: Adopt Wikibase DataModel 6.0
......................................................................
Adopt Wikibase DataModel 6.0
Change-Id: If403fe90ac4f73ceb2ce75962270eabad51b4133
---
M composer.json
M repo/tests/phpunit/includes/EditEntityTest.php
M repo/tests/phpunit/includes/Store/Sql/WikiPageEntityStoreTest.php
3 files changed, 11 insertions(+), 13 deletions(-)
Approvals:
Hoo man: Looks good to me, approved
jenkins-bot: Verified
diff --git a/composer.json b/composer.json
index f7e6688..f1fd0d0 100644
--- a/composer.json
+++ b/composer.json
@@ -33,10 +33,10 @@
"data-values/serialization": "~1.0",
"data-values/javascript": "~0.8.0",
"data-values/value-view": "~0.16.1",
- "wikibase/data-model": "~5.1",
- "wikibase/data-model-serialization": "~2.0",
- "wikibase/internal-serialization": "~2.2",
- "wikibase/data-model-services": "~3.4",
+ "wikibase/data-model": "~6.0",
+ "wikibase/data-model-serialization": "~2.2",
+ "wikibase/internal-serialization": "~2.3",
+ "wikibase/data-model-services": "~3.5",
"wikibase/data-model-javascript": "~2.0.0",
"wikibase/javascript-api": "~1.1",
"wikibase/serialization-javascript": "~2.0.5",
diff --git a/repo/tests/phpunit/includes/EditEntityTest.php
b/repo/tests/phpunit/includes/EditEntityTest.php
index 7458d4d..e4e7fe4 100644
--- a/repo/tests/phpunit/includes/EditEntityTest.php
+++ b/repo/tests/phpunit/includes/EditEntityTest.php
@@ -300,7 +300,7 @@
// change entity ----------------------------------
if ( $inputData === null ) {
- $item->clear();
+ $item = new Item( $item->getId() );
} else {
if ( !empty( $inputData['label'] ) ) {
foreach ( $inputData['label'] as $k => $v ) {
diff --git a/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityStoreTest.php
b/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityStoreTest.php
index 32f242e..8909bfa 100644
--- a/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityStoreTest.php
+++ b/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityStoreTest.php
@@ -97,15 +97,15 @@
$property->setDescription( 'en', 'Property description' );
return array(
- array( $item ),
- array( $property ),
+ array( $item, new Item() ),
+ array( $property, Property::newFromType( 'string' ) ),
);
}
/**
* @dataProvider simpleEntityParameterProvider()
*/
- public function testSaveEntity( EntityDocument $entity ) {
+ public function testSaveEntity( EntityDocument $entity, EntityDocument
$empty ) {
/* @var WikiPageEntityStore $store */
/* @var EntityRevisionLookup $lookup */
list( $store, $lookup ) = $this->createStoreAndLookup();
@@ -132,12 +132,10 @@
// TODO: check notifications in wb_changes table!
// update entity
- // FIXME: the clear() method is not defined by EntityDocument.
- // How else do we create an empty instance of the same
type?
- $entity->clear();
- $entity->getFingerprint()->setLabel( 'en', 'UPDATED' );
+ $empty->setId( $entityId );
+ $empty->getFingerprint()->setLabel( 'en', 'UPDATED' );
- $r2 = $store->saveEntity( $entity, 'update one', $user,
EDIT_UPDATE );
+ $r2 = $store->saveEntity( $empty, 'update one', $user,
EDIT_UPDATE );
$this->assertNotEquals( $r1->getRevisionId(),
$r2->getRevisionId(), 'expected new revision id' );
$r2actual = $lookup->getEntityRevision( $entityId );
--
To view, visit https://gerrit.wikimedia.org/r/276249
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If403fe90ac4f73ceb2ce75962270eabad51b4133
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Bene <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Bene <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Legoktm <[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