Skip to content

Commit c0656f6

Browse files
authored
Merge pull request #243 from wmde/release270
Make compatible with serialization/serialization 4.x
2 parents 37045e3 + 94e5737 commit c0656f6

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

RELEASE-NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
* Improved documentation of `SerializerFactory::newEntitySerializer` as well as
66
`DeserializerFactory::newEntityDeserializer`.
7+
* Added compatibility with Serialization 4.x
78

89
## 2.6.0 (2017-09-18)
910

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"require": {
3030
"php": ">=5.5.9",
3131
"wikibase/data-model": "~7.0|~6.0|~5.0|~4.2",
32-
"serialization/serialization": "~3.1",
32+
"serialization/serialization": "~4.0|~3.1",
3333
"data-values/serialization": "~1.0"
3434
},
3535
"require-dev": {
@@ -51,7 +51,7 @@
5151
},
5252
"extra": {
5353
"branch-alias": {
54-
"dev-master": "2.6.x-dev"
54+
"dev-master": "2.7.x-dev"
5555
}
5656
},
5757
"scripts": {

tests/integration/SnakSerializationRoundtripTest.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,15 @@ public function testStringValueToUnDeserializableValueRoundtrip() {
8787
$serialization = $serializer->serialize( $goodSnak );
8888
$newSnak = $deserializer->deserialize( $serialization );
8989

90-
$badSnak = new PropertyValueSnak( 42, new UnDeserializableValue( 'Yay', 'string', '' ) );
91-
$this->assertEquals( $badSnak, $newSnak );
90+
/** @var PropertyValueSnak $newSnak */
91+
$this->assertInstanceOf( PropertyValueSnak::class, $newSnak );
92+
$this->assertSame( 'P42', $newSnak->getPropertyId()->getSerialization() );
93+
94+
/** @var UnDeserializableValue $newValue */
95+
$newValue = $newSnak->getDataValue();
96+
$this->assertInstanceOf( UnDeserializableValue::class, $newValue );
97+
$this->assertSame( 'Yay', $newValue->getValue() );
98+
$this->assertSame( 'string', $newValue->getTargetType() );
9299
}
93100

94101
}

0 commit comments

Comments
 (0)