Skip to content

Commit cf61476

Browse files
jenkins-botGerrit Code Review
authored andcommitted
Merge "Assign statement ID in EntityDataSerializationServiceIntegrationTest"
2 parents e04cef8 + f5331cd commit cf61476

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceIntegrationTest.php

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ public function testItemRdfWithStub() {
3838
$property = new Property(
3939
null, $this->getFingerprintWithLabel( $propertyLabel ), 'wikibase-item'
4040
);
41-
4241
$store = WikibaseRepo::getEntityStore();
43-
4442
$store->saveEntity(
4543
$item1,
4644
'add some item',
@@ -53,23 +51,29 @@ public function testItemRdfWithStub() {
5351
$this->getTestUser()->getUser(),
5452
EDIT_NEW
5553
);
54+
5655
$labelText2 = 'some uniquish string - 354981328';
5756
$item2 = new Item(
58-
null, $this->getFingerprintWithLabel( $labelText2 ), null, new StatementList(
59-
new Statement(
60-
new PropertyValueSnak(
61-
$property->getId(), new EntityIdValue( $item1->getId() )
62-
)
63-
)
64-
)
57+
null, $this->getFingerprintWithLabel( $labelText2 ), null, null
6558
);
66-
59+
$store->assignFreshId( $item2 );
60+
$item2->setStatements( new StatementList(
61+
new Statement(
62+
new PropertyValueSnak(
63+
$property->getId(), new EntityIdValue( $item1->getId() )
64+
),
65+
null,
66+
null,
67+
"{$item2->getId()->getSerialization()}\$7b104d3a-95e5-4ed5-9675-5df817343361"
68+
)
69+
) );
6770
$item2Revision = $store->saveEntity(
6871
$item2,
6972
'some item',
7073
$this->getTestUser()->getUser(),
7174
EDIT_NEW
7275
);
76+
7377
$entityDataSerializationService = $this->getEntityDataSerializationService();
7478
$serialisedData = $entityDataSerializationService->getSerializedData(
7579
'ttl',

0 commit comments

Comments
 (0)