Skip to content

Commit e267bc2

Browse files
authored
Merge pull request #218 from wmde/release240
Release 2.4.0
2 parents 01337b4 + 7df1d61 commit e267bc2

File tree

6 files changed

+16
-15
lines changed

6 files changed

+16
-15
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ matrix:
1111
php: 5.6
1212
- env: DM=~4.2
1313
php: 7
14-
- env: DM=~4.2
14+
- env: DM=~7.0
1515
php: hhvm
1616
allow_failures:
1717
- env: DM=@dev

RELEASE-NOTES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Wikibase DataModel Serialization release notes
22

3+
## 2.4.0 (2017-03-16)
4+
5+
* Added compatibility with Wikibase DataModel 7.x
6+
37
## 2.3.0 (2017-02-15)
48

59
* Improved performance of `StatementDeserializer` as well as other deserializers

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"require": {
3030
"php": ">=5.5.0",
31-
"wikibase/data-model": "~6.0|~5.0|~4.2",
31+
"wikibase/data-model": "~7.0|~6.0|~5.0|~4.2",
3232
"serialization/serialization": "~3.1",
3333
"data-values/serialization": "~1.0"
3434
},
@@ -53,7 +53,7 @@
5353
},
5454
"extra": {
5555
"branch-alias": {
56-
"dev-master": "2.3.x-dev"
56+
"dev-master": "2.4.x-dev"
5757
}
5858
},
5959
"scripts": {

mediawiki-extension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
],
77
"url": "https://github.com/wmde/WikibaseDataModelSerialization",
88
"description": "Serializers and deserializers for the Wikibase DataModel",
9-
"version": "2.3.0",
9+
"version": "2.4.0",
1010
"type": "wikibase",
1111
"license-name": "GPL-2.0+",
1212
"manifest_version": 1

src/SerializerFactory.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,7 @@ public function newSnakListSerializer( $serializeSnaksWithHash = true ) {
221221
* @return Serializer
222222
*/
223223
public function newSnakSerializer( $serializeWithHash = true ) {
224-
return new SnakSerializer(
225-
$this->dataValueSerializer,
226-
$serializeWithHash
227-
);
224+
return new SnakSerializer( $this->dataValueSerializer, $serializeWithHash );
228225
}
229226

230227
/**

tests/unit/Serializers/SnakSerializerTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
class SnakSerializerTest extends DispatchableSerializerTest {
2020

2121
protected function buildSerializer() {
22-
return new SnakSerializer( new DataValueSerializer() );
22+
$serializeWithHash = false;
23+
return new SnakSerializer( new DataValueSerializer(), $serializeWithHash );
2324
}
2425

2526
public function serializableProvider() {
@@ -56,23 +57,20 @@ public function serializationProvider() {
5657
array(
5758
'snaktype' => 'novalue',
5859
'property' => 'P42',
59-
'hash' => '5c33520fbfb522444868b4168a35d4b919370018'
6060
),
6161
new PropertyNoValueSnak( 42 )
6262
),
6363
array(
6464
array(
6565
'snaktype' => 'somevalue',
6666
'property' => 'P42',
67-
'hash' => '1c5c4a30999292cd6592a7a6530322d095fc62d4'
6867
),
6968
new PropertySomeValueSnak( 42 )
7069
),
7170
array(
7271
array(
7372
'snaktype' => 'value',
7473
'property' => 'P42',
75-
'hash' => 'f39228cb4e94174c87e966c32b02ad93b3512fce',
7674
'datavalue' => array(
7775
'value' => 'hax',
7876
'type' => 'string',
@@ -83,13 +81,15 @@ public function serializationProvider() {
8381
);
8482
}
8583

86-
public function testSnakSerializationWithoutHash() {
87-
$serializer = new SnakSerializer( new DataValueSerializer(), false );
84+
public function testSnakSerializationWithHash() {
85+
$serializer = new SnakSerializer( new DataValueSerializer() );
8886

8987
$snak = new PropertyValueSnak( 42, new StringValue( 'hax' ) );
9088
$serialization = $serializer->serialize( $snak );
9189

92-
$this->assertArrayNotHasKey( 'hash', $serialization );
90+
$this->assertArrayHasKey( 'hash', $serialization );
91+
$this->assertInternalType( 'string', $serialization['hash'] );
92+
$this->assertNotEmpty( $serialization['hash'] );
9393
}
9494

9595
}

0 commit comments

Comments
 (0)