Skip to content

Commit

Permalink
Merge pull request #105 from wmde/fix-compat
Browse files Browse the repository at this point in the history
Fix compatibility with older DM versions
  • Loading branch information
JonasKress committed Mar 11, 2016
2 parents 78f3c73 + dc9653e commit 41d9f63
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 14 deletions.
31 changes: 23 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7
- hhvm
env:
- THENEEDFORTHIS=FAIL

matrix:
fast_finish: true
include:
- env: DM=~6.0
php: 5.3
- env: DM=~5.0
php: 5.4
- env: DM=~4.2
php: 5.5
- env: DM=~4.2
php: 5.6
- env: DM=~4.2
php: 7
- env: DM=~4.2
php: hhvm
exclude:
- env: THENEEDFORTHIS=FAIL
allow_failures:
- env: DM=@dev

sudo: false

install: travis_retry composer install --prefer-source
install: travis_retry composer require "wikibase/data-model=$DM" --prefer-source

script: composer ci

Expand Down
6 changes: 3 additions & 3 deletions tests/unit/Deserializers/LegacyItemDeserializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public function testGivenStatementWithLegacyKey_itemHasStatement() {
public function testGivenLabels_getLabelsReturnsThem( array $labels ) {
$item = $this->itemFromSerialization( array( 'label' => $labels ) );

$this->assertEquals( $labels, $item->getLabels()->toTextArray() );
$this->assertEquals( $labels, $item->getFingerprint()->getLabels()->toTextArray() );
}

public function TermListProvider() {
Expand All @@ -199,7 +199,7 @@ public function testGivenInvalidLabels_exceptionIsThrown() {
public function testGivenDescriptions_getDescriptionsReturnsThem( array $descriptions ) {
$item = $this->itemFromSerialization( array( 'description' => $descriptions ) );

$this->assertEquals( $descriptions, $item->getDescriptions()->toTextArray() );
$this->assertEquals( $descriptions, $item->getFingerprint()->getDescriptions()->toTextArray() );
}

public function testGivenInvalidAliases_exceptionIsThrown() {
Expand All @@ -213,7 +213,7 @@ public function testGivenInvalidAliases_exceptionIsThrown() {
public function testGivenAliases_getAliasesReturnsThem( array $aliases ) {
$item = $this->itemFromSerialization( array( 'aliases' => $aliases ) );

$this->assertEquals( $aliases, $item->getAliasGroups()->toTextArray() );
$this->assertEquals( $aliases, $item->getFingerprint()->getAliasGroups()->toTextArray() );
}

public function aliasesListProvider() {
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/Deserializers/LegacyPropertyDeserializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function testGivenLabels_getLabelsReturnsThem( array $labels ) {
'label' => $labels
) );

$this->assertEquals( $labels, $property->getLabels()->toTextArray() );
$this->assertEquals( $labels, $property->getFingerprint()->getLabels()->toTextArray() );
}

public function TermListProvider() {
Expand Down Expand Up @@ -123,7 +123,7 @@ public function testGivenDescriptions_getDescriptionsReturnsThem( array $descrip
'description' => $descriptions
) );

$this->assertEquals( $descriptions, $property->getDescriptions()->toTextArray() );
$this->assertEquals( $descriptions, $property->getFingerprint()->getDescriptions()->toTextArray() );
}

public function testGivenInvalidAliases_exceptionIsThrown() {
Expand All @@ -141,7 +141,7 @@ public function testGivenAliases_getAliasesReturnsThem( array $aliases ) {
'aliases' => $aliases
) );

$this->assertEquals( $aliases, $property->getAliasGroups()->toTextArray() );
$this->assertEquals( $aliases, $property->getFingerprint()->getAliasGroups()->toTextArray() );
}

public function aliasesListProvider() {
Expand Down

0 comments on commit 41d9f63

Please sign in to comment.